[C#] 纯文本查看 复制代码 HttpHelper http = new HttpHelper();
HttpItem itemLogin = new HttpItem()
{
URL = "https://passport.jd.com/new/login.aspx",
ResultCookieType = ResultCookieType.CookieCollection,
};
HttpResult result = http.GetHtml(itemLogin);
string Uuid = Regex.Match(result.Html, "(?<=uuid.*?value=\").*\"").Value.Replace("\"", "");
string MachineNet = "";
string MachineCpu = "";
string MachineDisk = "";
string Authcode = "";
string HiddenName = Regex.Match(result.Html, "clr.*?hidden.*?name=\"(\\w+)").Groups[1].Value;
string HiddenValue = Regex.Match(result.Html, "clr.*?hidden.*?value=\"(\\w+)").Groups[1].Value;
HttpItem itemPost = new HttpItem()
{
URL = "https://passport.jd.com/uc/loginService?uuid=" + Uuid + "&r=0.5113155191183683",
Method = "POST",
CookieCollection = result.CookieCollection,
ContentType = "application/x-www-form-urlencoded",
ResultCookieType = ResultCookieType.CookieCollection,
Referer = "https://passport.jd.com/new/login.aspx",
Postdata = String.Format("uuid={0}&loginname={1}&nloginpwd={2}&loginpwd={3}&machineNet={4}&machineCpu={5}&machineDisk={6}&authcode={7}&{8}={9}", Uuid, User, Pwd, Pwd, MachineNet, MachineCpu, MachineDisk, Authcode, HiddenName, HiddenValue),
};
result = http.GetHtml(itemPost);
itemPost = new HttpItem()
{
//订单页就访问正常
//URL = "http://jd2008.jd.com/JdHome/OrderList.aspx",
//下边是券地址,访问8次后就异常了
URL = "http://coupon.jd.com/ilink/couponActiveFront/front_index.action?key=22296322c4374e4c92906f56ba829244&roleId=3336690&to=sale.jd.com/act/QTS6qBhnomL0kJ1b.html&",
CookieCollection = result.CookieCollection,
ResultCookieType = ResultCookieType.CookieCollection
};
能够登陆成功,访问抢券地址也正常,但是访问超过8次后在访问这个地址,HttpWebResponse得到的内容就是空的,返回内容为空,麻烦飞哥给解决一下。
|