将文本文件从一个目录移动到另一个目录

时间:2020-04-07 01:26:19

标签: c# file directory

string sourcePath= @"F:\test\";
string targetPath= @"F:\transferedFiles\";

string filename="example.txt";

string sourceFile= System.IO.Path.Combine(sourcePath,filename);

string destFile = System.IO.Path.Combine(targetPath, filename);
System.IO.File.Move(sourceFile , destFile );

该程序在我的本地计算机上可以运行,但是在服务器上却无法运行。

0 个答案:

没有答案