{"请求被中止: 请求已被取消。"}
[System.Net.WebException]: {"请求被中止: 请求已被取消。"}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: {"在写入所有字节之前不能关闭流。"}
Message: "请求被中止: 请求已被取消。"
Source: "System"
StackTrace: " 在 System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)\r\n 在 System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState closeState)\r\n 在 System.Net.ConnectStream.Dispose(Boolean disposing)\r\n 在 System.IO.Stream.Close()\r\n 在 System.IO.StreamWriter.Dispose(Boolean disposing)\r\n 在 System.IO.StreamWriter.Close()\r\n 在 HttpRequestAndReponse.SendRequest(String indata) 位置 c:\\Inetpub\\wwwroot\\QPayment\\App_Code\\Common\\HttpRequestAndReponse.cs:行号 45"
TargetSite: {Void CloseInternal(Boolean, Boolean)}代码:
protected static HttpWebRequest SendRequest(string indata)
{
HttpWebRequest req;
try
{
//发起HTTP请求
req = (HttpWebRequest)WebRequest.Create(Constant.HTTP_URL);
req.Method = Constant.HTTP_METHOD;
req.ContentType = Constant.HTTP_CONTENTTYPE;
req.ContentLength = indata.Length;
req.UserAgent = Constant.HTTP_USERAGENT;
req.KeepAlive = true;
req.Headers.Add("Cmbc-E2bTxcode", "yq0100");
req.Headers.Add("Cmbc-E2bEcode", "rtdl");
Stream requestStream = req.GetRequestStream();
StreamWriter streamWriter = new StreamWriter(requestStream, Encoding.GetEncoding("GB2312"));
streamWriter.Write(indata);
req.Timeout = 30000;
streamWriter.Close();
requestStream.Close();
return req;
}
catch(Exception err)
{
throw new System.Exception("0");// 0:发送请求失败
}
}
[System.Net.WebException]: {"请求被中止: 请求已被取消。"}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: {"在写入所有字节之前不能关闭流。"}
Message: "请求被中止: 请求已被取消。"
Source: "System"
StackTrace: " 在 System.Net.ConnectStream.CloseInternal(Boolean internalCall, Boolean aborting)\r\n 在 System.Net.ConnectStream.System.Net.ICloseEx.CloseEx(CloseExState closeState)\r\n 在 System.Net.ConnectStream.Dispose(Boolean disposing)\r\n 在 System.IO.Stream.Close()\r\n 在 System.IO.StreamWriter.Dispose(Boolean disposing)\r\n 在 System.IO.StreamWriter.Close()\r\n 在 HttpRequestAndReponse.SendRequest(String indata) 位置 c:\\Inetpub\\wwwroot\\QPayment\\App_Code\\Common\\HttpRequestAndReponse.cs:行号 45"
TargetSite: {Void CloseInternal(Boolean, Boolean)}代码:
protected static HttpWebRequest SendRequest(string indata)
{
HttpWebRequest req;
try
{
//发起HTTP请求
req = (HttpWebRequest)WebRequest.Create(Constant.HTTP_URL);
req.Method = Constant.HTTP_METHOD;
req.ContentType = Constant.HTTP_CONTENTTYPE;
req.ContentLength = indata.Length;
req.UserAgent = Constant.HTTP_USERAGENT;
req.KeepAlive = true;
req.Headers.Add("Cmbc-E2bTxcode", "yq0100");
req.Headers.Add("Cmbc-E2bEcode", "rtdl");
Stream requestStream = req.GetRequestStream();
StreamWriter streamWriter = new StreamWriter(requestStream, Encoding.GetEncoding("GB2312"));
streamWriter.Write(indata);
req.Timeout = 30000;
streamWriter.Close();
requestStream.Close();
return req;
}
catch(Exception err)
{
throw new System.Exception("0");// 0:发送请求失败
}
}
解决方案 »
- 微软智能客户端??
- 随便发发:sql server数据库定时自动备份
- Model作为参数,Objectdatasource+formview绑定做添加修改操作,model属性默认值的设置
- 跪请高手乱入,asp+Jmail发邮件的问题!
- 请问如何在Visual Studio 2005创建asp.net项目?
- 取系统日期的函数?
- 关于button 的问题
- 安装了duwamish7后,打开文件出错,而且所有的资源文件都不认识。
- 想大家请教一个小问题!!谢谢
- 我的网卡怎么了?大哥大姐帮忙啊,分我一定给的
- 讨论:写了半年程序的迷惑?我感觉老写同样的程序没什么提高。除了我还有谁有这样的想法呢?
- 我通过formview进行增加或者修改,但是在gridview并不能及时的更新与显示,有办法解决吗
requestStream.Close();
交换一下位置试试