拒绝访问路径"C:\ Inetpub \ vhosts \ hgtechsolutions.com \ real2 \ subscribe.png". [英] Access to the path 'C:\Inetpub\vhosts\hgtechsolutions.com\real2\subscribe.png' is denied.

查看:52
本文介绍了拒绝访问路径"C:\ Inetpub \ vhosts \ hgtechsolutions.com \ real2 \ subscribe.png".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,
请帮助我找到解决此问题的方法

hi friends,
Please help me out in finding a solution for this problem

Server Error in ''/'' Application.
Access to the path ''C:\Inetpub\vhosts\hgtechsolutions.com\real2\subscribe.png'' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.





Exception Details: System.UnauthorizedAccessException: Access to the path ''C:\Inetpub\vhosts\hgtechsolutions.com\real2\subscribe.png'' is denied.



没有授权ASP.NET访问请求的资源.考虑将资源的访问权限授予ASP.NET请求标识. ASP.NET具有一个基本进程标识(在IIS 5上通常为{MACHINE} \ ASPNET或在IIS 6上通常为Network Service),如果应用程序无法模拟,则可以使用该标识.如果应用程序正在通过< identity impersonate ="true">进行模拟,则该身份将是匿名用户(通常为IUSR_MACHINENAME)或经过身份验证的请求用户.

要授予ASP.NET对文件的访问权限,请在资源管理器中右键单击该文件,选择属性",然后选择安全性"选项卡.单击添加"以添加适当的用户或组.突出显示ASP.NET帐户,然后选中所需访问权限的框.

源错误:



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.

Source Error:

Line 67:                 Label1.Text = "";
Line 68:                 string stt=Server.MapPath("../")+"subscribe.png";
Line 69:                 FileUpload1.PostedFile.SaveAs(stt);
Line 70:                 Label1.Text = "Peel-Off the Homepage - Special Ad! posted successfully";
Line 71:             }


但是localhost正在运行.


but localhost is running right on way.

推荐答案

不要忘记设置文件的读写权限.

文件和文件夹权限 [
dont forget set your files write- read permission.

File and Folder Permissions[^]


答案是在您遇到的异常中写的.

右键单击"UploadFiles"文件夹,然后转到安全性"选项卡,然后为尝试使用asp.net应用程序的用户(可能是aspnet_xxx用户或系统登录用户名或用户)授予完全权限(修改,写入,读取). ftp名称).

此错误与文件夹权限有关,请确保尝试上传文件的文件夹具有完全权限(读取,写入),并且不会收到此错误.

的帮助 dotnetfunda.com的raja(usa)
The answer is written in the exception you have got.

Right click your "UploadFiles" folder and go to security tab and allow full permission (modify, write, read) permission to the user who is trying to user the asp.net app (this might be the aspnet_xxx user or the system login username or the ftp name).

This error is related with the folder permission, make sure that the folder where you are trying to upload the file has full permission (read, write) and you will not get this error.
help of
raja(usa) from dotnetfunda.com


这篇关于拒绝访问路径"C:\ Inetpub \ vhosts \ hgtechsolutions.com \ real2 \ subscribe.png".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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