网址是http://www.chinesepen.org/ 这个需要翻墙 好像很多翻墙的站都是这个问题( 基础连接已经关闭: 接收时发生错误。)
需要怎么做 飞哥 "基础连接已经关闭: 接收时发生错误。"
get首页的数据是
[C#] 纯文本查看 复制代码 GET [url]http://www.chinesepen.org/[/url] HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3
User-Agent: Chrome (AppleWebKit/537.1; Chrome50.0; Windows NT 6.3; Trident/6.0; MASPJS)
Accept-Encoding: gzip, deflate
Host: [url]www.chinesepen.org[/url]
DNT: 1
Proxy-Connection: Keep-Alive
Pragma: no-cache
我写的代码是
[C#] 纯文本查看 复制代码 HttpHelper helper = new HttpHelper();
HttpResult result = new HttpResult();
HttpItem itemGet= new HttpItem()
{
URL = "http://www.chinesepen.org/",
Method = "GET",
Accept = "text/html, application/xhtml+xml, */*",
UserAgent = "Chrome (AppleWebKit/537.1; Chrome50.0; Windows NT 6.3; Trident/6.0; MASPJS)",
};
result = helper.GetHtml(itemGet);
var xxx = result.Html;
看到以前的帖子又说是加
myHttpWebRequest.KeepAlive = false;
myHttpWebRequest.ProtocolVersion = HttpVersion.Version10;
测试没效果
本地翻墙的 求飞哥帮忙看看 谢谢了
|