Horje
c# move files from one folder to another Code Example
move file from one folder to another 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);
c# move files from one folder to another
using System.IO;

string rootDirectory = @"C:\Users\USER\Folder1";
string destinationDirectory = @"C:\Users\USER\Folder2";

string[] Files = Directory.GetFiles(rootDirectory);

foreach (string file in Files) {
	File.Move(file, $"{destinationDirectory}{Path.GetFileName(file)}");
}




Csharp

Related
string methods in c# Code Example string methods in c# Code Example
mysql executeScalar only if successful Code Example mysql executeScalar only if successful Code Example
string trin c# Code Example string trin c# Code Example
serach a keyword in whole database Code Example serach a keyword in whole database Code Example
implicit vs explicit cast c# Code Example implicit vs explicit cast c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7