我对网站的签到截包的时候获取到
[C#] 纯文本查看 复制代码 GET /plugin.php?id=fx_checkin:checkin&formhash=d6587180&d6587180&infloat=yes&handlekey=fx_checkin&inajax=1&ajaxtarget=fwin_content_fx_checkin HTTP/1.1
Host: [url]www.unitymanual.com[/url]
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:25.0) Gecko/20100101 Firefox/25.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
X-Requested-With: XMLHttpRequest
Referer: [url]http://www.unitymanual.com/[/url]
Cookie: bdshare_firstime=1381110987077; 8ZMk_2132_ulastactivity=2578pG6OyYlUcJkqGp9YfbY1JDWAbCPRk7KxKgC6HLxWaBYG5tH6; 8ZMk_2132_connect_uin=97DF0465BC349C566738377E5F86607F; 8ZMk_2132_visitedfid=75D63D100D97D96D62D53D40D47; 8ZMk_2132_smile=1D1; CNZZDATA4924487=cnzz_eid%3D421972497-1383789400-http%253A%252F%252Fwww.unitymanual.com%26ntime%3D1389316235%26cnzz_a%3D0%26ltime%3D1389316233025%26rtime%3D25; 8ZMk_2132_connect_is_bind=1; 8ZMk_2132_auth=5e00iEkyxULrb1%2FftvqtQUbbNVl1wsGe4h3X2k8XaQHGY0coW6AlieXevzj1V03ZGnu3Q4N7kWjpVj%2FNJNO1eXRj; 8ZMk_2132_saltkey=sQyjd3JU; 8ZMk_2132_lastvisit=1386720851; 8ZMk_2132_lastcheckfeed=5157%7C1386724474; 8ZMk_2132_atarget=1; 8ZMk_2132_nofavfid=1; 8ZMk_2132_sid=jPuJt3; 8ZMk_2132_lip=112.94.150.36%2C1389230039; 8ZMk_2132_lastact=1389316237%09misc.php%09patch; 8ZMk_2132_connect_last_report_time=2014-01-10; 8ZMk_2132_sendmail=1; tjpctrl=1389318043604
Connection: keep-alive
然后自己模拟的时候
[C#] 纯文本查看 复制代码 //string loginUrl = "http://www.unitymanual.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1";登录的url
//fastloginfield=username&username=登录名&password=密码&quickforward=yes&handlekey=ls 登录的postdata
HttpHelper2 http = new HttpHelper2();
HttpItem item = new HttpItem()
{
URL = "http://www.unitymanual.com/",//URL 必需项
Encoding = System.Text.Encoding.GetEncoding("gbk"),//URL 可选项 默认为Get
Method = "get",//URL 可选项 默认为Get
Cookie = "",//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",/
ContentType = "text/html",//返回类型 可选项有默认值
};
result = http.GetHtml(item);
formhash = Regex.Match(result.Html, @"(?<=formhash=)\w+").Value;//获取formhash
string url = "http://www.unitymanual.com/plugin.php?id=fx_checkin:checkin&formhash=" +formhash+"&"+ formhash + "&infloat=yes&handlekey=fx_checkin&inajax=1&ajaxtarget=fwin_content_fx_checkin";
HttpItem item2 = new HttpItem()
{
URL = url,//URL 必需项
Method = "get",//URL 可选项 默认为Get
Cookie = result.Cookie,//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",/
ContentType = "text/html",//返回类型 可选项有默认值
Referer = "http://www.unitymanual.com/",
KeepAlive = true
};
result = http.GetHtml(item2);//签到
但是在result.html返回的是没有数据,网站上显示也是没有签到的,请问这是什么原因?
|