[C#] 纯文本查看 复制代码 HttpItem itemSign = new HttpItem() //获取_sign
{
URL = "https://account.xiaomi.com/pass/serviceLogin"
};
HttpHelper http = new HttpHelper();
HttpResult httpresult = http.GetHtml(itemSign);
Cookies = httpresult.Cookie;
HttpHelper helperSign = new HttpHelper();
HttpResult resultSign = helperSign.GetHtml(itemSign);//成功获取
//string sss = Regex.Match(resultSign.Html, "(?<=callback = encodeURIComponent\\(\").*\"", RegexOptions.IgnoreCase).Value.ToString().Replace("\"", "");
//string CallBack = System.Uri.EscapeDataString(Regex.Match(resultSign.Html, "(?<=callback = encodeURIComponent\\(\").*\"").Value.ToString().Replace("\"", ""));
//string FrameSrc = System.Uri.EscapeDataString(Regex.Match(httpresult.Html, "(?<=var iframeSrc = \").*\"").Value.ToString().Replace("\"", ""));
string postData = "passToken=&user=" + username + "&pwd=" + password + "&callback=https%3A%2F%2Faccount.xiaomi.com&sid=passport&qs=%253Fsid%253Dpassport&hidden=&_sign=KKkRvCpZoDC%2BgLdeyOsdMhwV0Xg%3D";
HttpItem item = new HttpItem() //登陆Post
{
URL = "https://account.xiaomi.com/pass/serviceLoginAuth2",
Method = "POST",
Referer = "https://account.xiaomi.com/pass/serviceLogin",
ContentType = "application/x-www-form-urlencoded",
//Postdata = string.Format("passToken={0}&user={1}&pwd={2}&callback={3}&sid={4}&qs={5}&hidden={6}&_sign={7}", "", username, password, CallBack, SID, QS, HIDDEN, SIGN)
Postdata = postData
};
HttpResult result = http.GetHtml(item);
richTextBox1.Text = result.Html;
为什么我的小米账号登录不了 出现了如下
The URL has moved <a href="https://account.xiaomi.com/sts?sid=passport&followup=%2Fpass%2FuserInfo%3FuserId%3D40051818&sign=pN6tkCpJ7iQBIHr4vSZT8ivbxSU%3D&auth=m7aaBwE1wm6mf6MEQxE3J6FEMOhPAUNr7VQlTUNe%2FixRn9%2BgqBisDYPqAdhuBNIUq7JsL9zVeo%2F%2FcAipZS3RExYbmYHkL4O4guGne9ktIofnnNYo9xPlPiElvacEEOWvFjqf%2FNu%2B%2FosXFk9OSufrF5pear6o7Gx04ImQ4Umifjw%3D&nonce=QfHtLyEg2PMBZn77&_ssign=GJCNGE%2BoJoT1YugbSZNndZk0ESQ%3D">here</a>
这是什么问题
|