无法访问已关闭的文件。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.ObjectDisposedException: 无法访问已关闭的文件。源错误:
行 70: if (!Directory.Exists(storePath))
行 71: Directory.CreateDirectory(storePath);
行 72: hif.PostedFile.SaveAs(storePath + "/" + Path.GetFileName(hif.PostedFile.FileName));
行 73: lbclueon.Text = "您的文件上传成功";
行 74: ListUpFile.Items.Clear();
源文件: d:\MyProgram\NetConsultation\Client\UploadImage.aspx.cs 行: 72 为什么我在VS2008调试都正常 放到IIS中就出现这个错误
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.ObjectDisposedException: 无法访问已关闭的文件。源错误:
行 70: if (!Directory.Exists(storePath))
行 71: Directory.CreateDirectory(storePath);
行 72: hif.PostedFile.SaveAs(storePath + "/" + Path.GetFileName(hif.PostedFile.FileName));
行 73: lbclueon.Text = "您的文件上传成功";
行 74: ListUpFile.Items.Clear();
源文件: d:\MyProgram\NetConsultation\Client\UploadImage.aspx.cs 行: 72 为什么我在VS2008调试都正常 放到IIS中就出现这个错误
我以前碰过停止了...启动你OK啦...
事件消息: 发生了未处理的异常。
事件时间: 2008-9-10 18:07:07
事件时间(UTC): 2008-9-10 10:07:07
事件 ID: 810bcf3e3e3a49bab9e62ba369e16763
事件序列: 20
事件匹配项: 3
事件详细信息代码: 0
应用程序信息:
应用程序域: /LM/W3SVC/1384023956/Root-2-128655137796406250
信任级别: Full
应用程序虚拟路径: /
应用程序路径: D:\MyProgram\NetConsultation\
计算机名: LIANGYAN
进程信息:
进程 ID: 4424
进程名: w3wp.exe
帐户名: NT AUTHORITY\NETWORK SERVICE
异常信息:
异常类型: ObjectDisposedException
异常消息: 无法访问已关闭的文件。
请求信息:
请求 URL: http://192.168.0.193:8080/Client/UploadImage.aspx
请求路径: /Client/UploadImage.aspx
用户主机地址: 192.168.0.193
用户:
是否已经过身份验证: False
身份验证类型:
线程帐户名: NT AUTHORITY\NETWORK SERVICE
线程信息:
线程 ID: 1
线程帐户名: NT AUTHORITY\NETWORK SERVICE
是否正在模拟: False
堆栈跟踪: 在 System.IO.__Error.FileNotOpen()
在 System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
在 System.Web.HttpRawUploadedContent.TempFile.GetBytes(Int32 offset, Int32 length, Byte[] buffer, Int32 bufferOffset)
在 System.Web.HttpRawUploadedContent.WriteBytes(Int32 offset, Int32 length, Stream stream)
在 System.Web.HttpInputStream.WriteTo(Stream s)
在 System.Web.HttpPostedFile.SaveAs(String filename)
在 Client_Default.Upload_Bn_Click(Object sender, ImageClickEventArgs e) 位置 d:\MyProgram\NetConsultation\Client\UploadImage.aspx.cs:行号 72
在 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
在 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
自定义事件详细信息: 有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持