|
http://www.sufeinet.com/thread-7109-1-1.html
用这个方法NameValueCollection dict = new NameValueCollection(); dict.Add("__VIEWSTATEGENERATOR", __VIEWSTATEGENERATOR); //dict.Add("__EVENTTARGET", ""); //dict.Add("__EVENTARGUMENT", ""); dict.Add("__EVENTVALIDATION",__EVENTVALIDATION); dict.Add("__VIEWSTATE", __VIEWSTATE); dict.Add("txtTile", names.Substring(0,names.Length-4)); //dict.Add("txtTile", "a"); //dict.Add("ckAddWmk_DT", "on"); dict.Add("ibUpload", "上传图片"); byte[] UploadBuffers = HttpPostDataByte(url, 5000, "fulImages", files, dict); HttpItem item = new HttpItem() { URL = url, Method = "POST", ContentType = "multipart/form-data; boundary=" + BoundStr.Substring(2), PostDataType = PostDataType.Byte, PostEncoding = Encoding.UTF8, PostdataByte = UploadBuffers, Cookie = cookie }; r = http.GetHtml(item); return r.Html;返回的数据是这样的?请问有见过的吗?还是我用的不太对,
HttpPostDataBytek的方法和网上的方法一样,只是返回的 byte[],然后再提交的数据!
“/”应用程序中的服务器错误。 此页的状态信息无效,可能已损坏。 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Web.HttpException: 此页的状态信息无效,可能已损坏。
源错误:
源文件: c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\fe557bf9\8990d032\App_Web_sxsah-g0.3.cs 行: 0
堆栈跟踪:
[ViewStateException: 无效的视图状态。 Client IP: 61.133.116.232 Port: 58618 User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) ViewState: /wEWBALH8O7YAgL55JyzBAKm9ZvQDQK157vkDoxBrQ7LCvkCa2mYh1PdhCtLBINh Referer: Path: /ImgUpload/CorpEditInsertImages_Add.aspx][HttpException (0x80004005): 此页的状态信息无效,可能已损坏。] System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +190 System.Web.UI.ClientScriptManager.EnsureEventValidationFieldLoaded() +359 System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +64 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +41 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11155303 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11154842 System.Web.UI.Page.ProcessRequest() +91 System.Web.UI.Page.ProcessRequest(HttpContext context) +240 ASP.imgupload_corpeditinsertimages_add_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\fe557bf9\8990d032\App_Web_sxsah-g0.3.cs:0 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171 |
版本信息: Microsoft .NET Framework 版本:2.0.50727.5485; ASP.NET 版本:2.0.50727.5491
|
|