DirectoryInfo.LastAccessTime : DirectoryInfo « System.IO « C# / C Sharp by API






DirectoryInfo.LastAccessTime

  

using System;
using System.IO;

class MainClass {
    static void Main(string[] args) {
        FileInfo file = new FileInfo("c:\\a.txt");

        // Display directory information.
        DirectoryInfo dir = file.Directory;

        Console.WriteLine("Checking directory: " + dir.Name);
        Console.WriteLine("In directory: " + dir.Name);
        Console.Write("Directory exists: ");
        Console.WriteLine(dir.Exists.ToString());

        if (dir.Exists) {
            Console.Write("Directory last accessed: ");
            Console.WriteLine(dir.LastAccessTime.ToString());
        }
        Console.WriteLine();
    }
}

   
    
  








Related examples in the same category

1.new DirectoryInfo(String path)
2.DirectoryInfo.CreateSubdirectory
3.DirectoryInfo.CreationTime
4.DirectoryInfo.Exists
5.DirectoryInfo.FullName
6.DirectoryInfo.GetDirectories()
7.DirectoryInfo.GetFiles()
8.DirectoryInfo.GetFiles(String filter)
9.DirectoryInfo.LastWriteTime
10.DirectoryInfo.Name
11.DirectoryInfo.Parent