public override string GetWebVerifyCode(string pVerifyCodeFile) { string pVerifyCode = ""; try { string str2 = $"/?useValid=true&rand={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); } FrmVerifyCode code = new FrmVerifyCode(pVerifyCodeFile); if (code.ShowDialog() == DialogResult.OK) { pVerifyCode = FrmVerifyCode.OutValue; } if (!this.CheckVerifyCode(pVerifyCode)) { return(this.GetWebVerifyCode(pVerifyCodeFile)); } } catch { } return(pVerifyCode); }
public override string GetWebVerifyCode(string pVerifyCodeFile) { string pVerifyCode = ""; try { bool flag; string loginLine = this.GetLoginLine(); string pUrl = this.GetLine() + "/DefaultCaptcha/Refresh"; string pResponsetext = ""; string pData = $"t={base.VerifyCodeToken}"; int num = 0; goto Label_007E; Label_003D: HttpHelper.GetResponse(ref pResponsetext, pUrl, "POST", pData, loginLine, 0x2710, "UTF-8", true); num++; if ((pResponsetext != "") || (num >= 2)) { goto Label_0083; } Label_007E: flag = true; goto Label_003D; Label_0083: 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); } FrmVerifyCode code = new FrmVerifyCode(pVerifyCodeFile); if (code.ShowDialog() == DialogResult.OK) { pVerifyCode = FrmVerifyCode.OutValue; } if (!this.CheckVerifyCode(pVerifyCode)) { return(this.GetWebVerifyCode(pVerifyCodeFile)); } } catch { } return(pVerifyCode); }