Moving a file : File Move : File Directory Stream C# Examples


C# Examples » File Directory Stream » File Move »

 

Moving a file









    
using  System;
using  System.IO;

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

        MyFile.Create();
        MyFile.MoveTo(@"c:\MyFolder\Moved  Testing.txt");
        MyFile.MoveTo(@"C:\MyFolderNew");
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» File Move