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#)
尝试File.Copy
,即
File.Copy(@"C:\File.txt", @"D:\Folder\File.txt");
You can use
Copies an existing file to a new file.
How to: Copy, Delete, and Move Files and Folders (C# Programming Guide)
Have you tried File.Copy(@"C:\\File.txt", @"D:\\Folder\\File.txt");
?
您是否尝试过File.Copy ?
然后,您可以使用File.Copy 。
请尝试File.Copy
。
就像下面这样...
System.IO.File.Copy(sourceFileName, destFileName);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.