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}"); }
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); }
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(); } }