下面是我的服务器目录(权限很好):
string ServerPath = ("\\\\servername\\Public\\Intranet2007Docs");我在这里访问它:
DirectoryInfo directory = new DirectoryInfo(Server.MapPath(ServerPath));下面是错误:

任何帮助都是最好的。我不明白为什么它不能映射到UNC的路径。
发布于 2012-12-07 23:34:24
尽量不要使用server.MapPath:
DirectoryInfo directory = new DirectoryInfo("\\\\servername\\Public\\Intranet2007Docs");发布于 2012-12-07 23:32:52
您只能在web应用程序内部的路径上使用MapPath。web应用程序外部的任何路径都没有相应的URL。
此外,DirectoyInfo方法对URL没有任何用处,所以根本不应该使用MapPath:
DirectoryInfo directory = new DirectoryInfo(ServerPath);https://stackoverflow.com/questions/13766094
复制相似问题