none
System.UnauthorizedAccessException: Access to the path 'd:/订单' is denied. RRS feed

  • 问题

  • Server Error in '/' Application.

    Access to the path 'd:/订单' 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 'd:/订单' 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.

    Source Error: 

    Line 188: {
    Line 189: Object Nothing = System.Reflection.Missing.Value;
    Line 190: Directory.CreateDirectory("d:/订单"); //创建文件所在目录
    Line 191: string name = DateTime.Now.ToString("yyyyMMdd") + orderid + productcode + ".doc";//不同订单应该是不同的名字
    Line 192: object filename = "d://订单//" + name; //文件保存路径

    Source File: e:\htdocs\Admin\Orders_Manage\Admin_ChkOrder.aspx.cs    Line: 190 

    Stack Trace: 

    [UnauthorizedAccessException: Access to the path 'd:/订单' is denied.]
     System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7716639
     System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity) +7569557
     System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity) +150
     System.IO.Directory.CreateDirectory(String path) +6
     Admin_Orders_Manage_Admin_ChkOrder.Output_Word(String orderid, Int32 productcode) in e:\htdocs\Admin\Orders_Manage\Admin_ChkOrder.aspx.cs:190
     Admin_Orders_Manage_Admin_ChkOrder.btn_Loadorder_Click(Object sender, EventArgs e) in e:\htdocs\Admin\Orders_Manage\Admin_ChkOrder.aspx.cs:180
     System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
     System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
     System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
     System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
     System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618

    ·这是一个购物网站的后台的自动生成订单的功能,生成一个WORD格式的订单,我在自己的IIS5上修改了文件权限,就能写到指定目录("d:/订单"),但是发布到ftp服务器上之后出现了这个异常。

    ·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. 这段话到底是什么意思,帮帮我,谢谢!

    2010年10月11日 12:13

答案