
try { httpWebRequest request = (httpWebRequest)WebRequest.Create(search); request.headers.Add("Accept-Language","de-DE"); request.Method = "GET"; request.Accept = "text/HTML"; using (httpWebResponse response = (httpWebResponse)request.GetResponse()) { using (StreamReader reader = new StreamReader(response.GetResponseStream(),EnCoding.ASCII)) { string HTML = reader.ReadToEnd(); FindForMatch(HTML,url); } } } catch (Exception ex) { throw new Exception(ex.Message); } 经过几个循环
Unable to read data from the transport connection: The connection was closed
错误.任何想法为什么会这样?感谢名单..
解决方法 加入后request.KeepAlive = false;request.ProtocolVersion = httpVersion.Version10;
它工作正常..
我发现它形成这个博文
WebRequest and Unable to read data from the transport connection Error
总结以上是内存溢出为你收集整理的c# – 无法从传输连接读取数据:控制台应用程序中的连接已关闭错误全部内容,希望文章能够帮你解决c# – 无法从传输连接读取数据:控制台应用程序中的连接已关闭错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)