我试图将文件从临时目录复制到用户选择的文件夹.我正在使用C#,我使用的文件夹是空的.
我正在使用的代码是:
File.Copy(srcPath, landscapebox.Text, true);
Run Code Online (Sandbox Code Playgroud)
srcPath 是一个临时文件夹
landscapebox是一个文本框,其中有一个目录输入.它应该看起来像:
"C:\Users\####\Folder\Folder"
Run Code Online (Sandbox Code Playgroud)
但相反,我得到:
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.
Run Code Online (Sandbox Code Playgroud)
救命!我不知道我做错了什么!