//Отправка капчи из картинки
var captcha__get = project.Variables["mailruGovno"].Value;
var image = System.Drawing.Image.FromFile(@captcha__get);
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);
image.Dispose();
}
var result = ZennoPoster.CaptchaRecognition("Rucaptcha.dll", base64String, "");
// отрезаем лишнее
var tmp = result.Split(new [] {"-|-"}, StringSplitOptions.None);
if (tmp.Length > 1)
{
File.Delete(captcha__get);
return tmp[0];
}
File.Delete(captcha__get);
return result;