コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public abstract PwdResetItem GetItemState(PwdResetItem item);