Questions tagged «unauthorizedaccessexcepti»

29
为什么拒绝访问路径?
我在尝试删除文件时遇到问题,但出现异常。 if (result == "Success") { if (FileUpload.HasFile) { try { File.Delete(Request.PhysicalApplicationPath + app_settings.login_images + txtUploadStatus.Text); string filename = Path.GetFileName(btnFileUpload.FileName); btnFileUpload.SaveAs(Request.PhysicalApplicationPath + app_settings.login_images + filename); } catch (Exception ex) { Message(ex.ToString()); } } } 另外,我应该注意,我尝试从中删除的文件夹对网络服务具有完全控制权。 完整的异常消息为: System.UnauthorizedAccessException:拒绝访问路径'C:\ Users \ gowdyn \ Documents \ Visual Studio 2008 \ Projects \ hybrid …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.