Exemplo n.º 1
0
        public CaptchaForm(CaptchaNeededException ex)
        {
            InitializeComponent();
            this.usedException = ex;
            this.CaptchaPictureBox.SizeMode = PictureBoxSizeMode.AutoSize;
            LoadCaptcha();

            //this.CaptchaPictureBox.
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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--;
        }
Exemplo n.º 4
0
 private void CaptchaHandler(CaptchaNeededException cEx)
 {
     Clients.All.RecognizeCaptcha(cEx.Img, cEx.Sid);
 }