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






DirectoryInfo.CreationTime

 
using System;
using System.IO;

class MainClass
{
    public static void Main(string[] args)
    {
        FileInfo file = new FileInfo("c:\\test.txt");    
        // Display directory information.
        DirectoryInfo dir = file.Directory;

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

   
  








Related examples in the same category

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