更新时间:2023-10-19 13:17:58
在将路径传递到文件名之前添加以下行:
Add this line before passing path to file name:
using System.IO;
要检查路径是否存在:
To Check if path exists:
if(!Directory.Exists(path))
{
//throw exception here or show message box like this:
MessageBox.Show(path);
}
else
{
//do something here.
}
要检查文件是否存在:
To check if file exists:
if(File.Exists(filepath)
{
//throw exception here or show message box like this:
MessageBox.Show(filepath)
}
else
{
//do something here.
}
只需逐行调试,看看哪里出现此错误
Just debug line by line and see where you are getting this error