コード例 #1
0
 private void BtnConfirm_Click(object sender, EventArgs e)
 {
     Solution     = new Web.Captcha.CaptchaSolution(txtCaptcha.Text, null, Config);
     DialogResult = DialogResult.OK;
     Close();
     Logger.Debug($"Captcha solution: {Solution.Solution}");
 }
コード例 #2
0
        public CaptchaDialog(HttpHandler httpHandler, Action <string> updateStatus, Models.CaptchaSolvingConfig config)
        {
            Logger.Debug("Init. solving captcha...");

            Solution = new Web.Captcha.CaptchaSolution(false, "Something went wrong...", config);

            _httpHandler = httpHandler;

            InitializeComponent();

            LoadCaptcha(updateStatus, Config = config);
        }
コード例 #3
0
 private void LoadCaptcha(Action <string> updateStatus, Models.CaptchaSolvingConfig config)
 {
     if (config.Enabled)
     {
         Logger.Debug("Solving captcha using services...");
         Solution = _httpHandler.SolveCaptcha(updateStatus, config);
     }
     else
     {
         Logger.Debug("Solving captcha using dialog box...");
         boxCaptcha.Image = _httpHandler.GetCaptchaImageraw();
     }
 }