Reputation: 1386
I want to save one file from one path to another path.
Eg:
Original path : C:\File.txt
New path : D:\Folder\File.txt
Can i use:
File.Move("C:\File.txt", "D:\Folder\File.txt");
But i think this will remove file from original path. (C#)
Upvotes: 0
Views: 3306
Reputation: 336
Just like this below...
System.IO.File.Copy(sourceFileName, destFileName);
Upvotes: 1
Reputation: 187050
You can use
Copies an existing file to a new file.
How to: Copy, Delete, and Move Files and Folders (C# Programming Guide)
Upvotes: 2
Reputation: 1062855
Try File.Copy
, i.e.
File.Copy(@"C:\File.txt", @"D:\Folder\File.txt");
Upvotes: 5
Reputation: 1342
Have you tried File.Copy(@"C:\File.txt", @"D:\Folder\File.txt");
?
Upvotes: 1