查看: 769|回复: 1
|
用asp.net delete file时遇到的小问题
[复制链接]
|
|
当我用一下的code来delete我server的file时,出现以下的msg
我知道问题所在,但我的情况是。。 所有的files都是透过我的asp.net application来upload上server的,总不能每一次upload都要用FTP program来grant access to the file 吧
Server Error in '/' Application.
Access to the path 'stephy_shine_s.gif' is denied.
Description:An unhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path 'stephy_shine_s.gif' is denied.
ASP.NETis not authorized to access the requested resource. Consider grantingaccess rights to the resource to the ASP.NET request identity. ASP.NEThas a base process identity (typically {MACHINE}\ASPNET on IIS 5 orNetwork Service on IIS 6) that is used if the application is notimpersonating. If the application is impersonating via <identityimpers/>, the identity will be the anonymous user(typically IUSR_MACHINENAME) or the authenticated request user.
Togrant ASP.NET access to a file, right-click the file in Explorer,choose "Properties" and select the Security tab. Click "Add" to add theappropriate user or group. Highlight the ASP.NET account, and check theboxes for the desired access.
Source Error:
An unhandledexception was generated during the execution of the current webrequest. Information regarding the origin and location of the exceptioncan be identified using the exception stack trace below.
|
|
|
|
|
|
|
|
|
发表于 29-1-2007 02:35 PM
|
显示全部楼层
你只要设那Directory就可以了,
那么文件会inherit这directory的设定 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|