[C#] 纯文本查看 复制代码 HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://www.qqhrhb.gov.cn/branch.aspx?id=10401",//URL 必需项
Method = "post",//URL 可选项 默认为Get
IsToLower = false,//得到的HTML代码是否转成小写 可选项默认转小写
Cookie = "ASP.NET_SessionId=ur5xjrigk3ashrmlbgj52p55",//字符串Cookie 可选项
Referer ="http://www.qqhrhb.gov.cn/branch.aspx?id=10401",//来源URL 可选项
Postdata = "__VIEWSTATE=%2FwEPDwUKMTI2NzIyNjQ4Mw8WAh4IdGhpc3BhZ2UCARYCAgEPZBYIAgIPDxYCHgRUZXh0BVYgPGEgaHJlZj1DYXRlZ29yeS5hc3B4P2lkPTEwNCBjbGFzcz10aXQxMz7njq%2For4Tpobnnm648L2E%2BIC0%2BIOWuoeaJuemhueebruWPl%2BeQhuaDheWGtWRkAgMPDxYCHwEFGOWuoeaJuemhueebruWPl%2BeQhuaDheWGtWRkAgQPPCsADQEADxYGHgtfIURhdGFCb3VuZGceCVBhZ2VDb3VudAIBHgtfIUl0ZW1Db3VudAISZBYCZg9kFihmDw8WAh4HVmlzaWJsZWhkZAIBD2QWBGYPZBYCZg8VAiA2RDEyNkRFQTczNjg2QzgxRTkwOUZCQUIzQjYyMEY1ME%2FlhbPkuo4yMDE15bm0NeaciDIw5pel5bu66K6%2B6aG555uu546v5aKD5b2x5ZON6K%2BE5Lu35paH5Lu25Y%2BX55CG5oOF5Ya155qE5YWs56S6ZAIBDw8WAh8BBQoyMDE1LTA1LTIwZGQCAg9kFgRmD2QWAmYPFQIgNkQxMjZERUE3MzY4NkM4MTVBRkE4NjlCMTUwQkQwN0VP5YWz5LqOMjAxNeW5tDXmnIgxOOaXpeW7uuiuvumhueebrueOr%2BWig%2BW9seWTjeivhOS7t%2BaWh%2BS7tuWPl%2BeQhuaDheWGteeahOWFrOekumQCAQ8PFgIfAQUKMjAxNS0wNS0xOGRkAgMPZBYEZg9kFgJmDxUCIDI1OTNFNzZEQzY5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blj5fnkIbmg4XlhrXnmoTlhaznpLpkAgEPDxYCHwEFCjIwMTQtMTItMTlkZAITDw8WAh8FaGRkAgYPDxYCHwVnZGQYAQUKTXlHcmlkVmlldw9nZE4U7C%2FH%2BM2y2X0VHMP%2FAWOgDqwg&DetailsText=&nextpage=%CF%C2%D2%BB%D2%B3&gotopagebox",//Post数据 可选项GET时不需要写
Timeout = 100000,//连接超时时间 可选项默认为100000
ReadWriteTimeout = 30000,//写入Post数据超时时间 可选项默认为30000
UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",//用户的浏览器类型,版本,操作系统 可选项有默认值
ContentType = "application/x-www-form-urlencoded",//返回类型 可选项有默认值
Allowautoredirect = false,//是否根据301跳转 可选项
//CerPath = "d:\123.cer",//证书绝对路径 可选项不需要证书时可以不写这个参数
//Connectionlimit = 1024,//最大连接数 可选项 默认为1024
ProxyIp = "",//代理服务器ID 可选项 不需要代理 时可以不设置这三个参数
//ProxyPwd = "123456",//代理服务器密码 可选项
//ProxyUserName = "administrator",//代理服务器账户名 可选项
ResultType = ResultType.String
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
string cookie = result.Cookie;
算法自己想办法解决吧
|