文件访问被拒绝

编程入门 行业动态 更新时间:2024-10-27 03:38:34
本文介绍了文件访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的应用程序中,我们使用IIS 7.0和Windows Server2008. 当我尝试从应用程序访问excell文件时,出现以下错误.

Hi, In my application we are using IIS 7.0 and windows server 2008. When i try to access the excell file from the application it gives the below error.

Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\Project\ProjectFolder\Templates\SubBranchDetails.xls' 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 <identity impersonate="true"/>, 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.

不要给出建议使文件成为这样的读写模式.我尝试了所有

Don''t give suggestions to make file as read and write mode like that. I tried all

推荐答案

您实际上尝试按照错误消息中的说明进行操作吗? 要授予ASP.NET对文件的访问权限,请在资源管理器中右键单击该文件,选择属性",然后选择安全性"选项卡.单击添加"以添加适当的用户或组.突出显示ASP.NET帐户,然后选中所需访问权限的框." Did you actually try doing what it says in the error message? "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."

您需要授予该文件夹的权限 授予许可 去这里 C:\ Project \ ProjectFolder \ Templates \ 右键单击该文件,选择属性",然后选择安全性"选项卡. 单击添加"以添加适当的用户或组. 如果文件不包含任何安全信息,那么您可以授予所有人访问权限. 突出显示ASP.NET帐户,然后选中所需访问权限的框 You need to give permissions to that folder to give permission Go here C:\Project\ProjectFolder\Templates\ Right-click the file , choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. If the file don''t contain any secured info then you can give access to everyone. Highlight the ASP.NET account, and check the boxes for the desired access

尝试Griff给出的步骤.只有您可能需要提供对帐户的权限-II7中的"网络服务". Try the Steps given by Griff. Only you may require to provide permissions to the Account -"Network Services" in II7.

更多推荐

文件访问被拒绝

本文发布于:2023-10-13 00:33:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486303.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:被拒   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!