题
我想用C#将文件从A复制到B。我怎么做?
解决方案
文件复制方法:
其他提示
没有任何错误处理代码:
File.Copy(path, path2);
使用 FileInfo 类。
FileInfo fi = new FileInfo("a.txt");
fi.CopyTo("b.txt");
系统.IO.文件.复制
这应该有效!
using System.IO;
...
var path = //your current filePath
var outputPath = //the directory where you want your (.txt) file
File.Copy(path,outputPath);
不隶属于 StackOverflow