Moving a file : File Move « File Directory Stream « C# / CSharp Tutorial






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");
  }
}








15.5.File Move
15.5.1.Moving a file