Have you ever wanted trick your friends into believing that you created a Text File the day after you were born? When you tell them that you created a Text File the day after you were born, they are probably thinking that you are just kidding, until you show them the File's Creation, Last Accessed, and Last Written Date. You should title the File something like MyFirstTextFile.txt

Now for the Code and Explanation.

What this code does is it changes the File's Creation, Last Accessed, and Last Written Date to the Date you specify. Your friends won't believe you, but for some odd reason, they will.

private void changeFileDate(String filename, DateTime newDate)
{
//Try to change the Creation Time
try
{
//Here we are setting the Creation Time to the
//specified date called newDate, for the file
//called filename
System.IO.File.SetCreationTime(filename, newDate);
}
catch
{
MessageBox.Show("There seems to be an error with the specified FileName or the specified Date.", "Error");
}
//Try to change the Last Write Time to our CreationTime
try
{
//Here we are setting the Last Write Time to the Creation Date
System.IO.File.SetLastWriteTime(filename, newDate);
}
catch
{
MessageBox.Show("There seems to be an error with the specified FileName or the specified Date.", "Error");
}
//Try to change the Last Accessed Time to our CreationTime and to our LastWriteTime
try
{
//Here we are setting the Last Accessed Time to the Creation Date and the Last Write Time
System.IO.File.SetLastAccessTime(filename, newDate);
}
catch
{
MessageBox.Show("There seems to be an error with the specified FileName or the specified Date.", "Error");
}
}