我当前正在创建一个文件夹并将文件写入需要在我们拥有的文件服务器上创建的文件夹。当我进行本地主机测试时,它工作得很好,但是当我从本地主机外部和另一台电脑访问网站时。据说是这样的
System.UnauthorizedAccessException: Access to the path 'My File Server URL' is denied
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
但问题是我已经在 web.config 中设置了身份 impersonate="true"但它仍然不起作用。我的 Web 服务器在 Winder Server 2003 和 IIS 6 上运行
任何建议和帮助将不胜感激
谢谢 布兰登
最佳答案
您需要向该文件/文件夹
的Users
组授予写入
、修改
权限。
关于c# - 访问该路径被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7762770/