Create a file and get its creation time, full name and Attributes : File Create : File Directory Stream C# Examples


C# Examples » File Directory Stream » File Create »

 

Create a file and get its creation time, full name and Attributes









    
using  System;
using  System.IO;

public  class  MainClass
{
        public  static  int  Main(string[]  args)
        {            
        FileInfo  f  =  new  FileInfo(@"C:\Test.txt");
        FileStream  fs  =  f.Create();

        Console.WriteLine("Creation:  {0}",  f.CreationTime);
        Console.WriteLine("Full  name:  {0}",  f.FullName);
        Console.WriteLine("Full  atts:  {0}",  f.Attributes.ToString());

        fs.Close();
        f.Delete();            

                return  0;
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» File Create