[C#] 纯文本查看 复制代码 HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "https://account.xiaomi.com/pass/serviceLogin",//URL 必需项
Encoding = null,//编码格式(utf-8,gb2312,gbk) 可选项 默认类会自动识别
Method = "GET",//URL 可选项 默认为Get
Timeout = 100000,//连接超时时间 可选项默认为100000
ReadWriteTimeout = 30000,//写入Post数据超时时间 可选项默认为30000
IsToLower = false,//得到的HTML代码是否转成小写 可选项默认转小写
Cookie = "",//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0",//用户的浏览器类型,版本,操作系统 可选项有默认值
Accept = "text/html, application/xhtml+xml, */*",// 可选项有默认值
ContentType = "text/html",//返回类型 可选项有默认值
Referer = "https://account.xiaomi.com/pass/serviceLogin",
Postdata = "",//Post数据 可选项GET时不需要写
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
string _sign = Helper.ApplySpecifiedText(html, "name=\"_sign\" value=\"", "\">");
string cookie = result.Cookie;
byte[] b = result.ResultByte;
item = new HttpItem()
{
URL = "https://account.xiaomi.com/pass/serviceLoginAuth2",//URL 必需项
Encoding = null,//编码格式(utf-8,gb2312,gbk) 可选项 默认类会自动识别
Method = "POST",//URL 可选项 默认为Get
Timeout = 100000,//连接超时时间 可选项默认为100000
ReadWriteTimeout = 30000,//写入Post数据超时时间 可选项默认为30000
IsToLower = false,//得到的HTML代码是否转成小写 可选项默认转小写
Cookie = cookie,//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0",//用户的浏览器类型,版本,操作系统 可选项有默认值
Accept = "text/html, application/xhtml+xml, */*",// 可选项有默认值
ContentType = "text/html",//返回类型 可选项有默认值
Referer = "https://account.xiaomi.com",//来源URL 可选项
Postdata = "passToken=&passport_ph=&user=18566232230&pwd=lcq89436052&callback=http%3A%2F%2Faccount.xiaomi.com&sid=passport&qs=%253Fsid%253Dpassport&hidden=&_sign=" + _sign,//Post数据 可选项GET时不需要写
};
result = http.GetHtml(item);
html = result.Html;
txtLog.Text =Helper.RemoveHTML(html);
签名值不合法
是不是我少了什么 求大神帮忙 |