Sending local jpg file to captcha Services

bfirst

Client
Регистрация
05.11.2013
Сообщения
56
Благодарностей
0
Баллы
6
Hi again.

Today I have some new problems. I am trying to create bo which will register new accounts on this forum :
http://www.alopezie.de/fud/index.php/re/0/
As you see, there is one smart captcha made from text :-). I have already created a jpg file using c# code
Код:
HtmlElement he = instance.ActiveTab.FindElementByAttribute("div","style","white-space.+","regexp",0);
int heHeight = Convert.ToInt32(he.GetAttribute("height"));
int heWidth = Convert.ToInt32(he.GetAttribute("width"));
int step =1000;
int countOfIterations = heHeight/step;
var bitmaps = new List<System.Drawing.Bitmap>();
int count =0;
for(int i =0;i<countOfIterations;i++)
{
    var text = he.DrawPartToBitmap(0, i*step, heWidth, step, true);
    byte[] imageBytes = Convert.FromBase64String(text);
    var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
    var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
    img.Save(@"C:\images\captcha.jpg");
    count++;
}
int lastPieceHeight = heHeight%step;
if (lastPieceHeight>10)
{
    var text = he.DrawPartToBitmap(0, heHeight-lastPieceHeight, heWidth, lastPieceHeight, true);
    byte[] imageBytes = Convert.FromBase64String(text);
    var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
    var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
    img.Save(@"C:\images\captcha.jpg");
}
But now I do not know how to send this captcha jpg file to captcha breaking service. Can you help me?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
  • Спасибо
Реакции: bfirst

bfirst

Client
Регистрация
05.11.2013
Сообщения
56
Благодарностей
0
Баллы
6
Thanks. It is the solution for me :-)
 

roobsx

Client
Регистрация
11.07.2012
Сообщения
13
Благодарностей
2
Баллы
3

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
permissions was fixed
 

PHaRTnONu

Client
Регистрация
01.10.2016
Сообщения
340
Благодарностей
48
Баллы
28
permission is still denied.....
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 241
Благодарностей
5 848
Баллы
113
permission is still denied.....
have you tried this code?
Код:
var image = System.Drawing.Image.FromFile(@"C:\1.png");
  
string base64String = String.Empty;
  
using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
    image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
    byte[] imageBytes = ms.ToArray();
      
    base64String = Convert.ToBase64String(imageBytes);
}
  
var result = ZennoPoster.CaptchaRecognition("Anti-Captcha.dll", base64String, "");
  
var split = result.Split(new [] {"-|-"}, StringSplitOptions.RemoveEmptyEntries);
if (split.Length == 2) return split[0];
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)