为什么拒绝对路径的访问?
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()); } }}
系统。未授权的AccessException:对路径C:\USERS\gowdyn\Documents\VisualStudio 2008\Projects\hybrid\temp_loginimages\enviromental.jpg‘的访问被拒绝。在System.IO._Error.WinIOError(Int 32错误代码,String MaybeFullPath)处System.IO.File.Delete(字符串路径)位于C:\hybrid.User_Controls.Imgloader_Add_Edit_Tbl.btnUpdate_Click(Object\gowdyn\Documents\VisualStudio 2008\Projects\hybrid\User_Controls\Imgloader_Add_Edit_Tbl.ascx.cs:line 242中
慕斯王
慕村9548890