【发布时间】:2016-11-30 19:38:55
【问题描述】:
我试图将文件从临时目录复制到用户选择的文件夹。我使用的是 C#,我使用的文件夹是空的。
我使用的代码是:
File.Copy(srcPath, landscapebox.Text, true);
srcPath 是一个临时文件夹
landscapebox 是一个文本框,其中将输入一个目录。它应该看起来像:
"C:\Users\####\Folder\Folder"
但是我得到了:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The target file "C:\Users\###\Desktop\####\TestFolder" is a directory, not a file.
帮助!我不知道我做错了什么!
【问题讨论】: