0
protected void btnAutomaticUpload_Click(object sender, EventArgs e)
{
DirectoryInfo dir = new DirectoryInfo(@"\\space-bar\UZ\UZ Dept\Management\Data\directory_exists_here\");
bool atLeastOneSuccessfulUpload = false;
bool possibleFormatChange = false;
lblMessages.Text = string.Empty;
lblResults.Text = "<span style='font-size:large; font-weight:bold'><u>Results Log</u></span><br><br>";
//If our destination directory does not exist, exit
if (!dir.Exists)
{
lblResults.Text += "<span style='color:Red'>Expected directory does not exist!</span><br>" + dir.FullName;
return;
}
因此,我一直试图在带有映射网络驱动器的活服务器上运行此代码,但它总是似乎无法找到该文件夹。虽然当我在Debug或LocalHost模式下运行时,它似乎能够找到没有问题的目录。任何想法,即使UNC路径编码,为什么它不起作用?这与权限有关吗?DirectoryInfo.Exists找不到我映射的网络驱动器C#
我想构建一个自动文件上传解析器。
在调试时,代码是否在服务器和本地上以同一用户身份运行?如果他们是不同的用户,这可能是一个权限问题。 – PatrickSteele