Asp.net网络应用程序在IIS服务器上托管,在共享同一网络的其他服务器上访问共享目录中的文件,得到错误信息。
[Access to file path "\ServerName\some/folder\on/disk/file.txt" is denied"].我给了IISUser,MachineUser,直到Everyone的权限,但是没有结果。
但当我从同一服务器的IIS中的一个实用程序(POC)访问路径时,它访问路径并下载字符串,但从Web应用程序中却返回错误。
string filepath = @"\\ServerName\some\folder\on\disk\file.txt"
using(Webclient client = new Webclient())
{
filetext = client.DownloadString(filepath)
}