Exemplo n.º 1
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);
        }