move file C# code example
Example 1: move file from one folder to another c#
string rootFolderPath = @"F:/model_RCCMREC/";
string destinationPath = @"F:/model_RCCMrecTransfered/";
string filesToDelete = @"*_DONE.wav";
string[] fileList = System.IO.Directory.GetFiles(rootFolderPath, filesToDelete);
foreach (string file in fileList)
{
string fileToMove = rootFolderPath + file;
string moveTo = destinationPath + file;
File.Move(fileToMove, moveTo);
Example 2: move file c#
File.Move(@"c:\temp\MyTest.txt", @"c:\temp2\MyTest.txt");