未能找到路径“C:\Users\Administrator\Desktop\论文\WSSC\Admin\Upfile\2016410180951.jpg”的一部分。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.IO.DirectoryNotFoundException: 未能找到路径“C:\Users\Administrator\Desktop\论文\WSSC\Admin\Upfile\2016410180951.jpg”的一部分。
源错误:
行 181: pathurl = Server.MapPath("~") + "\Admin\Upfile\" + newname;
行 182: string kb = file1.FileContent.Length.ToString();
行 183: file.PostedFile.SaveAs(pathurl);
行 184: return newname;
行 185: }
堆栈跟踪:
[DirectoryNotFoundException: 未能找到路径“C:\Users\Administrator\Desktop\论文\WSSC\Admin\Upfile\2016410180951.jpg”的一部分。]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +224
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, Boolean useLongPath) +1142
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +78
System.IO.FileStream..ctor(String path, FileMode mode) +71
System.Web.HttpPostedFile.SaveAs(String filename) +99
Product_Update.upPhoto(FileUpload file) in c:\Users\Administrator\Desktop\论文\WSSC\Web\Admin\Product_Manage\Product_Update.aspx.cs:183
Product_Update.btnUpPic_Click(Object sender, EventArgs e) in c:\Users\Administrator\Desktop\论文\WSSC\Web\Admin\Product_Manage\Product_Update.aspx.cs:150
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +120
System.Web.UI.WebControls.ImageButton.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) +5563