Directory.CreationTime : Directory « System.IO « C# / C Sharp by API






Directory.CreationTime

  

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 created: ");
            Console.WriteLine(dir.CreationTime.ToString());
        }
        Console.WriteLine();
    }
}

   
    
  








Related examples in the same category

1.Directory.Delete
2.Directory.Exists
3.Directory.GetCurrentDirectory()
4.Directory.GetFiles
5.Directory.GetLogicalDrives
6.Directory.SetCurrentDirectory(String path)