public CaptchaForm(CaptchaNeededException ex) { InitializeComponent(); this.usedException = ex; this.CaptchaPictureBox.SizeMode = PictureBoxSizeMode.AutoSize; LoadCaptcha(); //this.CaptchaPictureBox. }
public Captcha(CaptchaNeededException ex) { System.Uri url = ex.Img; System.Net.WebClient client = new System.Net.WebClient(); System.Drawing.Image img = System.Drawing.Image.FromStream(new MemoryStream(client.DownloadData(url))); BitmapImage bitmap = ToWpfImage(img); CaptchaImage.Height = bitmap.Height; CaptchaImage.Width = bitmap.Width; CaptchaImage.Source = ToWpfImage(img); long captcha_sid = ex.Sid; InitializeComponent(); }
private void RepeatSolveCaptchaAsync(CaptchaNeededException captchaNeededException, ref int numberOfRemainingAttemptsToSolveCaptcha, ref long?captchaSidTemp, ref string captchaKeyTemp) { _logger?.LogWarning("Повторная обработка капчи"); if (numberOfRemainingAttemptsToSolveCaptcha < MaxCaptchaRecognitionCount) { _captchaSolver?.CaptchaIsFalse(); } if (numberOfRemainingAttemptsToSolveCaptcha <= 0) { return; } captchaSidTemp = captchaNeededException.Sid; captchaKeyTemp = _captchaSolver?.Solve(captchaNeededException.Img?.AbsoluteUri); numberOfRemainingAttemptsToSolveCaptcha--; }
private void CaptchaHandler(CaptchaNeededException cEx) { Clients.All.RecognizeCaptcha(cEx.Img, cEx.Sid); }