對路徑「C:\inetpub\wwwroot3\wechat\img\qrcode\」的訪問被拒絕。服務器
說明: 執行當前 Web 請求期間,出現未經處理的異常。請檢查堆棧跟蹤信息,以瞭解有關該錯誤以及代碼中致使錯誤的出處的詳細信息。
異常詳細信息: System.UnauthorizedAccessException: 對路徑「C:\inetpub\wwwroot3\wechat\img\qrcode\」的訪問被拒絕。
ASP.NET 無權訪問所請求的資源。請考慮對 ASP.NET 請求標識授予訪問此資源的權限。ASP.NET 有一個在應用程序沒有模擬時使用的基進程標識(一般,在 IIS 5 上爲 {MACHINE}\ASPNET,在 IIS 6 和 IIS 7 上爲網絡服務,在 IIS 7.5 上爲配置的應用程序池標識)。若是應用程序正在經過 <identity impersonate="true"/> 模擬,則標識將爲匿名用戶(一般爲 IUSR_MACHINENAME)或通過身份驗證的請求用戶。
To grant ASP.NET access to a file, right-click the file in File 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.
源錯誤:
網絡
行 60: if (!System.IO.Directory.Exists(path)) 行 61: {行 62: System.IO.Directory.CreateDirectory(path); 行 63: } 行 64: string savePath = string.Format("{0}storebook.png", path); |
源文件: F:\storebook\Purple\Purple.WebWeChat\Controllers\QrCodeController.cs 行: 62
堆棧跟蹤:
app
[UnauthorizedAccessException: 對路徑「C:\inetpub\wwwroot3\wechat\img\qrcode\」的訪問被拒絕。] System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +10797126 System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) +10589134 System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) +136 System.IO.Directory.CreateDirectory(String path) +33 Purple.WebWeChat.Controllers.QrCodeController.Storebook() in F:\storebook\Purple\Purple.WebWeChat\Controllers\QrCodeController.cs:62 lambda_method(Closure , ControllerBase , Object[] ) +62 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +205 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 System.Web.Mvc.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a() +56 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +256 System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c() +22 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +190 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324 System.Web.Mvc.Controller.ExecuteCore() +105 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +42 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10 System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +31 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19 System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +43 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9628972 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 |
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.18055 async