文件访问被拒绝 [英] File Access is Denied

查看:544
本文介绍了文件访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的应用程序中,我们使用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.


这篇关于文件访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆