Copying A File by using FileInfo : File Copy : File Directory Stream C# Examples


C# Examples » File Directory Stream » File Copy »

 

Copying A File by using FileInfo









    
using  System;
using  System.IO;

public  class  MainClass
{
    static  void  Main(string[]  args)
    {
        FileInfo  MyFile  =  new  FileInfo(@"c:\Projects\Testing.txt");

        MyFile.Create();
        MyFile.CopyTo(@"c:\Folder\Testing.txt");

        //or
        MyFile.CopyTo(@"c:\Folder\Testing.txt",  true);
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» File Copy