|
楼主 |
发表于 2013-12-4 10:40:23
|
显示全部楼层
看了啊,知道了,要加一句这个item.ResultCookieType = ResultCookieType.CookieCollection;
但是还是报错,说验证码错误
item.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";//返回类型 可选项有默认值
item.Method = "post";
item.Referer = "https://login.taobao.com/member/request_nick_check.do?_input_charset=UTF-8&username=" + HttpUtility.UrlEncode(txtLoginId.Text);
item.Postdata = string.Format("TPL_username={0}&TPL_password={1}&TPL_checkcode={2}&need_check_code=true&callback=1&newlogin=1",
HttpUtility.UrlEncode(txtLoginId.Text.Trim()),
HttpUtility.UrlEncode(txtPwd.Text.Trim()),
HttpUtility.UrlEncode(txtVcode.Text.Trim()));//Post数据 可选项GET时不需要写
item.Cookie = cookies;
item.CookieCollection = cookieCollection;
HttpResult result = m_Http.GetHtml(item);
string html = result.Html;
|
|