|
楼主 |
发表于 2013-8-30 23:13:06
|
显示全部楼层
注册不成功,返回的html和注册界面一样。求分析
/////////////////////////////////////////////
//获取验证码
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "https://account.xiaomi.com/pass/getCode?icodeType=register",//URL 必需项
Encoding = null,//编码格式(utf-8,gb2312,gbk) 可选项 默认类会自动识别
ResultType = ResultType.Byte
};
//得到HTML代码
HttpResult result = http.GetHtml(item);
//表示StatusCode的文字说明与描述
string statusCodeDescription = result.StatusDescription;
//把得到的Byte转成图片
Image img = byteArrayToImage(result.ResultByte);
picbox.Image = img;
cookie = result.Cookie;
//注册
HttpHelper helper = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "https://account.xiaomi.com/pass/register",
Cookie = cookie,
KeepAlive=true,
Postdata="passToken=&qs=&email=fansuo39177%40sohu.com&password=xiaomi123&repassword=xiaomi123&inputcode="+ txtyzm.Text,
Method="post",
Referer="https://account.xiaomi.com/pass/register?",
ContentType = "application/x-www-form-urlencoded",
Allowautoredirect = true
};
HttpResult result = helper.GetHtml(item);
string html = result.Html;
|
|