夥計們我試圖將所有以_DONE結尾的文件移動到另一個文件夾中。將文件從一個文件夾移動到另一個C#
我試圖
//take all files of main folder to folder model_RCCMrecTransfered
string rootFolderPath = @"F:/model_RCCMREC/";
string destinationPath = @"F:/model_RCCMrecTransfered/";
string filesToDelete = @"*_DONE.wav"; // Only delete WAV files ending by "_DONE" in their filenames
string[] fileList = System.IO.Directory.GetFiles(rootFolderPath, filesToDelete);
foreach (string file in fileList)
{
string fileToMove = rootFolderPath + file;
string moveTo = destinationPath + file;
//moving file
File.Move(fileToMove, moveTo);
但在執行這些代碼我得到一個錯誤的說法。
The given path's format is not supported.
我哪裏出錯了?
我不知道窗口中的文件傳輸是否支持'_' – Rohit