Exemplo n.º 1
0
        public QLoginStatus CheckStatus()
        {
            string url = "https://ssl.ptlogin2.qq.com/ptqrlogin?" +
                         "u1=https%3A%2F%2Fvip.qq.com%2Floginsuccess.html" +
                         "&ptqrtoken=" + hash33(qrsig) + "& ptredirect=0&h=1&t=1&g=1&from_ui=1" +
                         "&ptlang=2052&action=2-2-" + timelong() +
                         "&js_ver=" + js_ver + "&js_type=1&login_sig=" + pt_login_sig +
                         "&pt_uistyle=40&aid=8000201&daid=18&ptdrvs=7fRIHUtdVn*L6rtb4Sbtwj7iqWHop2yqlomOfknzYLmuMGdskWZJ-Sg8I3ruHDGW4Y8LlNCZs88_&sid=6602311080099795114" +
                         "&has_onekey=1&";
            var data = _get_with_cookies(url, MainCookies);

            if (data.IndexOf("登录成功") >= 0)
            {
                CurrentStatus = QLoginStatus.Pending;
                string verifyurl = Regex.Match(data, "(http.*)'").Groups[1].Value;
                var    verify    = _get_with_cookies(verifyurl, MainCookies);
                CurrentStatus = QLoginStatus.Online;
            }
            else if (data.IndexOf("二维码未失效") >= 0)
            {
                CurrentStatus = QLoginStatus.Pending;
            }
            else if (data.IndexOf("二维码已失效") >= 0)
            {
                CurrentStatus = QLoginStatus.QRExpired;
            }
            else if (data.IndexOf("参数错误") >= 0)
            {
                CurrentStatus = QLoginStatus.Failed;
            }
            return(CurrentStatus);
        }
Exemplo n.º 2
0
        public Bitmap getQR()
        {
            string stat1 = _get_with_cookies(
                "http://ui.ptlogin2.qq.com/cgi-bin/login?appid=8000201&daid=18&pt_no_auth=1&s_url=https%3A%2F%2Fvip.qq.com%2Floginsuccess.html",
                MainCookies);

            js_ver = Regex.Match(stat1, "ptui_version:encodeURIComponent\\(\"([0-9]*)\"\\)").Groups[1].Value;
            var qr = _get_image_with_cookies(
                "http://ptlogin2.qq.com/ptqrshow?appid=8000201&e=2&l=M&s=3&d=72&v=4&t=0." + random.Next(10000000, 99999999) + random.Next(10000000, 99999999) + "&daid=18",
                MainCookies);
            var collection = MainCookies.GetCookies(new Uri("https://ui.ptlogin2.qq.com/"));

            pt_login_sig  = collection["pt_login_sig"].Value;
            qrsig         = collection["qrsig"].Value;
            CurrentStatus = QLoginStatus.Pending;
            return(qr);
        }