Last active
August 29, 2015 14:05
-
-
Save dannko/30fc8bcabcdb7ee7a209 to your computer and use it in GitHub Desktop.
Разгадывание капчи на C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var captcha__get = project.Variables["captcha_file"].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); | |
} | |
var result = ZennoPoster.CaptchaRecognition("Anti-Captcha.dll", base64String, ""); | |
// отрезаем лишнее | |
var tmp = result.Split(new [] {"-|-"}, StringSplitOptions.None); | |
if (tmp.Length > 1) return tmp[0]; | |
return result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment