C# DirectoryInfo LastAccessTime
Description
DirectoryInfo LastAccessTime
Gets or sets the time the
current file or directory was last accessed.
Syntax
DirectoryInfo.LastAccessTime
has the following syntax.
public DateTime LastAccessTime { get; set; }
Example
Gets the time the current file or directory was last accessed.
using System;//from w w w. ja v a 2 s . com
using System.IO;
class Class1
{
public static void Main(){
DirectoryInfo target = new DirectoryInfo("c:/abc");
Console.WriteLine(target.LastAccessTime);
}
}
The code above generates the following result.