C# FileInfo LastWriteTime
Description
FileInfo LastWriteTime
Gets or sets the time when the
current file or directory was last written to.
Syntax
FileInfo.LastWriteTime
has the following syntax.
public DateTime LastWriteTime { get; set; }
Example
Gets the time when the current file or directory was last written to.
using System;/*www . j a v a2 s . c o m*/
using System.IO;
public class DirectoryTest
{
public static void Main()
{
FileInfo fi = new FileInfo("temp.txt");
Console.WriteLine(fi.LastWriteTime);
}
}
The code above generates the following result.