C# moving a file from one directory to another
var fileName = @"xyz.txt";
var fromPath = @"c:\test\";
var toPath = @"c:\test\complete\";
public static void MoveFileToDirectory(string moveFile)
{
string fileOrigin = fromPath + moveFile;
string fileDestination = toPath + moveFile;
File.Move(fileOrigin, fileDestination);
}
MoveFileToDirectory(fileName);
No comments:
Post a Comment