The SetLastWriteTime and GetLastWriteTime methods are used to set and get the last write date and time of the specified file. The following code snippet sets and gets the last write date and time of a file.
// Get and set file last write timestring fileName = @"c:\temp\Mahesh.txt";File.SetLastWriteTime(fileName, DateTime.Now);DateTime dt = File.GetLastWriteTime(fileName);Console.WriteLine("File last write time: {0}", dt.ToString());
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: