廣告:
環(huán)境:asp.net mvc2.0 asp.net 3.5 sp1
“/bzzs”應用程序中的服務器錯誤。
對路徑“D:\wwwroot\www-hbsztv-com\www-hbsztv-com3\bzzs\Img\2015\3\m2015031782f4763a47644d0f8b39d6c079720545.jpg”的訪問被拒絕。
說明: 執(zhí)行當前 Web 請求期間,出現(xiàn)未處理的異常。請檢查堆棧跟蹤信息,以了解有關該錯誤以及代碼中導致錯誤的出處的詳細信息。
異常詳細信息: System.UnauthorizedAccessException: 對路徑“D:\wwwroot\www-hbsztv-com\www-hbsztv-com3\bzzs\Img\2015\3\m2015031782f4763a47644d0f8b39d6c079720545.jpg”的訪問被拒絕。
ASP.NET 未被授權訪問所請求的資源。請考慮授予 ASP.NET 請求標識訪問此資源的權限。ASP.NET 有一個在應用程序沒有模擬時使用的基進程標識(通常,在 IIS 5 上為 {MACHINE}\ASPNET,在 IIS 6 上為網(wǎng)絡服務)。如果應用程序正在通過 <identity impersonate="true"/> 模擬,則標識將為匿名用戶(通常為 IUSR_MACHINENAME)或經(jīng)過身份驗證的請求用戶。
要將 ASP.NET 訪問權限授予某個文件,請在資源管理器中右擊該文件,選擇“屬性”,然后選擇“安全”選項卡。單擊“添加”添加適當?shù)挠脩艋蚪M。突出顯示 ASP.NET 帳戶,選中所需訪問權限對應的框。
源錯誤:
執(zhí)行當前 Web 請求期間生成了未處理的異常?梢允褂孟旅娴漠惓6褩8櫺畔⒋_定有關異常原因和發(fā)生位置的信息。
堆棧跟蹤:
[UnauthorizedAccessException: 對路徑“D:\wwwroot\www-hbsztv-com\www-hbsztv-com3\bzzs\Img\2015\3\m2015031782f4763a47644d0f8b39d6c079720545.jpg”的訪問被拒絕。]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7716339
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1162
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +61
System.IO.FileStream..ctor(String path, FileMode mode) +55
System.Web.HttpPostedFile.SaveAs(String filename) +99
Mvccom.Funs.Upfile(HttpPostedFile control, Page page1, Int32 type) +955
Mvcb2b.editors.uploadinc.Upmappic.Page_Load(Object sender, EventArgs e) in E:\aspnet2.0\hao_elec_all_jia\mvc_elec_jia\Mvcb2b\editors\uploadinc\Upmappic.aspx.cs:43
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
版本信息: Microsoft .NET Framework 版本:2.0.50727.5420; ASP.NET 版本:2.0.50727.5420
解決方法:網(wǎng)站目錄添加IIS_user和Network Service兩個用戶的寫入權限
廣告: