How to Extraction Text from an captcha Image Using vb.net

Sandipan Karmaker picture Sandipan Karmaker · May 24, 2012 · Viewed 8.3k times · Source

Using vb.net how to extract text from captcha images

Answer

Robert Beaubien picture Robert Beaubien · May 24, 2012

A little research on your part can go a long way. To answer your question, there is a service called "Death By Captcha" (http://www.deathbycaptcha.eu). They have a .NET API and they are pretty reliable.

Here is sample C# code for decoding a captcha:

// Do not forget to reference DeathByCaptcha.dll in your project!
using DeathByCaptcha;

// Put your DBC credentials here.
// Use HttpClient class if you want to use HTTP API.
Client client = (Client) new SocketClient(USERNAME, PASSWORD);

// Put your CAPTCHA file name, stream, or vector of bytes,
// and desired timeout (in seconds) here:
Captcha captcha = client.Decode(CAPTCHA_FILE_NAME, TIMEOUT);
if (captcha.Solved && captcha.Correct) {
    Console.WriteLine("CAPTCHA {0}: {1}", captcha.Id, captcha.Text);

    // Report the CAPTCHA if solved incorrectly.
    // Make sure the CAPTCHA was in fact incorrectly solved!
    if ( ... ) {
        client.Report(captcha);
    }
}

// Repeat for other CAPTCHAs

Easy to translate to VB