简体   繁体   中英

How to save one file from one path to another path? Without removing file from original path using C#

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");

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM