protected bool GetLoginContentWithCaptcha(PwdResetItem item, string captchaCode, ref string content) { if (null != item) { string postData = string.Format(this.PostContentWithCaptchaFormat, item.EMail, item.FirstName, item.SecondName, captchaCode); LogManager.Info(string.Format("-> post data:{0}", postData)); content = string.Empty; content = this.ReadUrlContent(DetectionParamsItem.CurrentGameServer.PasswordResetUrl, postData); return(true); } return(false); }
public override PwdResetItem GetItemState(PwdResetItem item) { if (null != item) { string html = string.Empty; GetLoginContent(item, ref html); if (!string.IsNullOrEmpty(html)) { int i = 0; do { item.State = this.GetState(html); if (item.IsValidName) { break; } else if (item.IsNeedCaptcha) { string captcha = string.Empty; if (this.GetCatcha(html, ref captcha) && !string.IsNullOrEmpty(captcha)) { this.GetLoginContentWithCaptcha(item, captcha, ref html); } } } while (i++ < this.DetectionParamsItem.ErrorRepeatCount); if (item.IsValidName) { string question = this.GetQuestion(html); PostAnswer(question); } } } return(item); }
public abstract PwdResetItem GetItemState(PwdResetItem item);