Move a folder with Directory.Move method in CSharp

Description

The following code shows how to move a folder with Directory.Move method.

Example


using System;//from  w  w w. j a v a  2s . co m

class Class1
{
    static void Main(string[] args)
    {
        Move("C:\\proof", "C:\\Temp");
    }
    static void Move(string sourcePath, string destinationPath)
    {
        System.IO.Directory.Move(sourcePath, destinationPath);
        System.Console.WriteLine("The directory move is complete.");
    }
}




















Home »
  C# Tutorial »
    IO »




File Attribute
File Security
Directory Attribute
Directory Recursive
Binary File
Text Field
Buffered IO
Create Copy Delete Move
CSV
Drive
File System Watcher
Isolated Storage
MemoryStream
Serialize
Zip