Ejemplo n.º 1
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.GetResponse10(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);
        }