c# - 访问该路径被拒绝

标签 c# asp.net iis-6

我当前正在创建一个文件夹并将文件写入需要在我们拥有的文件服务器上创建的文件夹。当我进行本地主机测试时,它工作得很好,但是当我从本地主机外部和另一台电脑访问网站时。据说是这样的

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/

相关文章:

c# - C#-如何使用索引将字符串的一部分输出到控制台

c# - 如何正确实例化 HttpContext 对象?

c# - 损坏的查询字符串 : "80" being removed by IIS?

iis - 这些 IIS 绑定(bind)是什么,它们的目的是什么?

c# - WCF 自定义 JSONP 绑定(bind)和 httpsTransport

c# - 空 linq 查询结果异常

c# - 如何为我的 gridview 实现 DTO?

c# - ASP.NET 计划删除临时文件

c# - HttpContext的线程安全

asp.net - 我可以在下拉列表中添加一个值为 0 且文本为空字符串的列表项吗?