Answers for "move files from one folder to another using c#"

C#
0

move files from one folder to another using c#

using System.IO;

string rootDirectory = @"C:UsersUSERFolder1";
string destinationDirectory = @"C:UsersUSERFolder2";

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

foreach (string file in Files) {
	File.Move(file, $"{destinationDirectory}{Path.GetFileName(file)}");
}
Posted by: Guest on February-07-2022

Code answers related to "move files from one folder to another using c#"

C# Answers by Framework

Browse Popular Code Answers by Language