Пример #1
0
        public override string GetWebVerifyCode(string pVerifyCodeFile)
        {
            string pVerifyCode = "";

            try
            {
                string str2 = $"/images/set_check_code/?session_name=user_login&type=4&rand={DateTime.Now.ToString()}";
                string pUrl = this.GetLine() + str2;
                File.Delete(pVerifyCodeFile);
                Bitmap bitmap = new Bitmap(HttpHelper.GetResponseImage(pUrl, "", "GET", "", 0x1770, "UTF-8", true));
                bitmap.Save(pVerifyCodeFile);
                bitmap.Dispose();
                while (!File.Exists(pVerifyCodeFile))
                {
                    Thread.Sleep(500);
                }
                pVerifyCode = VerifyCodeAPI.VerifyCodeMain(base.PTID, pVerifyCodeFile);
                if (!this.CheckVerifyCode(pVerifyCode))
                {
                    return(this.GetWebVerifyCode(pVerifyCodeFile));
                }
            }
            catch
            {
            }
            return(pVerifyCode);
        }
Пример #2
0
        public override string GetWebVerifyCode(string pVerifyCodeFile)
        {
            string pVerifyCode = "";

            try
            {
                string str2 = $"/captcha/default?{DateTime.Now.ToOADate()}";
                string pUrl = this.GetLine() + str2;
                File.Delete(pVerifyCodeFile);
                Bitmap bitmap = new Bitmap(HttpHelper.GetResponseImage(pUrl, "", "GET", "", 0x1770, "UTF-8", true));
                bitmap.Save(pVerifyCodeFile);
                bitmap.Dispose();
                while (!File.Exists(pVerifyCodeFile))
                {
                    Thread.Sleep(500);
                }
                pVerifyCode = VerifyCodeAPI.VerifyCodeMain(base.PTID, pVerifyCodeFile);
                if (!this.CheckVerifyCode(pVerifyCode))
                {
                    return(this.GetWebVerifyCode(pVerifyCodeFile));
                }
            }
            catch
            {
            }
            return(pVerifyCode);
        }
Пример #3
0
        public override string GetWebVerifyCode(string pVerifyCodeFile)
        {
            string pVerifyCode = "";

            try
            {
                string loginLine     = this.GetLoginLine();
                string pUrl          = this.GetLine() + "/?s=/ApiPublic/getNewCaptcha/";
                string pResponsetext = "";
                string pSource       = "\"\"";
                pSource = this.GetEncode(pSource, true);
                HttpHelper.GetResponse(ref pResponsetext, pUrl, "POST", pSource, loginLine, 0x2710, "UTF-8", true);
                pResponsetext = CommFunc.GetIndexString(pResponsetext, "t=", "\"", 0);
                string str6 = $"/?s=/WebPublic/captcha/&_CAPTCHA&t={pResponsetext}";
                string str7 = this.GetLine() + str6;
                File.Delete(pVerifyCodeFile);
                Bitmap bitmap = new Bitmap(HttpHelper.GetResponseImage(str7, "", "GET", "", 0x1770, "UTF-8", true));
                bitmap.Save(pVerifyCodeFile);
                bitmap.Dispose();
                while (!File.Exists(pVerifyCodeFile))
                {
                    Thread.Sleep(500);
                }
                pVerifyCode = VerifyCodeAPI.VerifyCodeMain(base.PTID, pVerifyCodeFile);
                if (!this.CheckVerifyCode(pVerifyCode))
                {
                    return(this.GetWebVerifyCode(pVerifyCodeFile));
                }
            }
            catch
            {
            }
            return(pVerifyCode);
        }
Пример #4
0
        public override string GetWebVerifyCode(string pVerifyCodeFile)
        {
            string pVerifyCode = "";

            try
            {
                this.VerifyCodeKey = "";
                string str2 = "/user/vcode";
                string pUrl = this.GetLine() + str2;
                File.Delete(pVerifyCodeFile);
                string pReferer      = "";
                string pResponsetext = "";
                HttpHelper.GetResponse(ref pResponsetext, pUrl, "GET", string.Empty, pReferer, 0x2710, "UTF-8", true);
                string pImageString = CommFunc.GetIndexString(pResponsetext, "\"VerifyCode\":\"", "\"", 0);
                this.VerifyCodeKey = CommFunc.GetIndexString(pResponsetext, "\"VerifyKey\":\"", "\"", 0);
                Image image = CommFunc.ConvertImageBy64String(pImageString);
                image.Save(pVerifyCodeFile);
                image.Dispose();
                while (!File.Exists(pVerifyCodeFile))
                {
                    Thread.Sleep(500);
                }
                pVerifyCode = VerifyCodeAPI.VerifyCodeMain(base.PTID, pVerifyCodeFile);
                if (!this.CheckVerifyCode(pVerifyCode))
                {
                    return(this.GetWebVerifyCode(pVerifyCodeFile));
                }
            }
            catch
            {
            }
            return(pVerifyCode);
        }
Пример #5
0
        public override string GetWebVerifyCode(string pVerifyCodeFile)
        {
            string pVerifyCode = "";

            try
            {
                string str2 = "/Login/authnum";
                string pUrl = this.GetLine() + str2;
                File.Delete(pVerifyCodeFile);
                string loginLine = this.GetLoginLine();
                Bitmap bitmap    = new Bitmap(HttpHelper.GetResponseImage(pUrl, loginLine, "GET", "", 0x1770, "UTF-8", true));
                bitmap.Save(pVerifyCodeFile);
                bitmap.Dispose();
                while (!File.Exists(pVerifyCodeFile))
                {
                    Thread.Sleep(500);
                }
                pVerifyCode = VerifyCodeAPI.VerifyCodeMain(base.PTID, pVerifyCodeFile);
                if (!this.CheckVerifyCode(pVerifyCode))
                {
                    return(this.GetWebVerifyCode(pVerifyCodeFile));
                }
            }
            catch
            {
            }
            return(pVerifyCode);
        }
Пример #6
0
        public override string GetWebVerifyCode(string pVerifyCodeFile)
        {
            string pVerifyCode = "";

            try
            {
                bool flag;
                if (!this.GetLoginYZM())
                {
                    return(pVerifyCode);
                }
                string loginLine     = this.GetLoginLine();
                string pUrl          = this.GetLine() + "/DefaultCaptcha/Refresh";
                string pResponsetext = "";
                string pData         = $"t={base.VerifyCodeToken}";
                int    num           = 0;
                goto Label_0092;
Label_0051:
                HttpHelper.GetResponse(ref pResponsetext, pUrl, "POST", pData, loginLine, 0x2710, "UTF-8", true);
                num++;
                if ((pResponsetext != "") || (num >= 2))
                {
                    goto Label_0097;
                }
Label_0092:
                flag = true;
                goto Label_0051;
Label_0097:
                if (pResponsetext == "")
                {
                    return(pVerifyCode);
                }
                base.VerifyCodeToken = CommFunc.GetIndexString(pResponsetext, "\"value\", \"", "\"", 0);
                string str6 = $"/DefaultCaptcha/Generate?t={base.VerifyCodeToken}";
                string str7 = this.GetLine() + str6;
                File.Delete(pVerifyCodeFile);
                Bitmap bitmap = new Bitmap(HttpHelper.GetResponseImage(str7, loginLine, "GET", "", 0x1770, "UTF-8", true));
                bitmap.Save(pVerifyCodeFile);
                bitmap.Dispose();
                while (!File.Exists(pVerifyCodeFile))
                {
                    Thread.Sleep(500);
                }
                pVerifyCode = VerifyCodeAPI.VerifyCodeMain(base.PTID, pVerifyCodeFile);
                if (!this.CheckVerifyCode(pVerifyCode))
                {
                    return(this.GetWebVerifyCode(pVerifyCodeFile));
                }
            }
            catch
            {
            }
            return(pVerifyCode);
        }
Пример #7
0
        public override string GetWebVerifyCode(string pVerifyCodeFile)
        {
            string pVerifyCode = "";

            try
            {
                string str2 = $"/public/getValidCodeByJosn?time={DateTime.Now.ToOADate()}";
                string pUrl = this.GetLine() + str2;
                if (File.Exists(pVerifyCodeFile))
                {
                    File.Delete(pVerifyCodeFile);
                }
                string pData         = $"__RequestVerificationToken={base.Token}";
                string loginLine     = this.GetLoginLine();
                string pResponsetext = "";
                HttpHelper.GetResponse(ref pResponsetext, pUrl, "POST", pData, loginLine, 0x2710, "UTF-8", true);
                if (pResponsetext == "")
                {
                    return(pVerifyCode);
                }
                string s = CommFunc.GetIndexString(pResponsetext, "base64,", "\"", 0);
                this.EncrypCode = CommFunc.GetIndexString(pResponsetext, "\"EncrypCode\":\"", "\"", 0);
                byte[]       buffer = Convert.FromBase64String(s);
                MemoryStream stream = new MemoryStream(buffer, true);
                stream.Write(buffer, 0, buffer.Length);
                Bitmap bitmap = new Bitmap(stream);
                bitmap.Save(pVerifyCodeFile);
                bitmap.Dispose();
                while (!File.Exists(pVerifyCodeFile))
                {
                    Thread.Sleep(500);
                }
                pVerifyCode = VerifyCodeAPI.VerifyCodeMain(base.PTID, pVerifyCodeFile);
                this.VC     = CommFunc.GetIndexString(pResponsetext, "\"vc\":\"", "\"", 0);
                if (!this.CheckVerifyCode(pVerifyCode))
                {
                    return(this.GetWebVerifyCode(pVerifyCodeFile));
                }
            }
            catch
            {
            }
            return(pVerifyCode);
        }