Sunil Jagadish

CAPTCHA Generator for .NET

with 5 comments

I needed a CAPTCHA generator for some stuff I’ve been doing. I looked around and did find some assemblies for .NET. I thought of coding my own CAPTCHA generator and decided to do this using C#. The result – You can download/contribute here. You can even download a sample usage of this in a Windows Forms application form the “Releases” section. This can even be used in ASP.NET applications. This assembly will need permission to write to disk (to store the CAPTCHA image generated).


using CAPTCHA;
CaptchaGenerator cgen;

Single custom coloured CAPTCHA
cgen.CaptchaColor = Color.FromArgb(130, 120, 130);
CaptchaText = cgen.GenerateCaptcha(@”G:\test1.gif”);
pictureBox1.ImageLocation = @”G:\test1.gif”;


Default Random Coloured CAPTCHA
CaptchaText = cgen.GenerateCaptcha(@”G:\test1.gif”);
pictureBox1.ImageLocation =


Written by Sunil

2007.07.25 at 07:26 PM

Posted in .NET

5 Responses

Subscribe to comments with RSS.

  1. 😉


    2007.07.28 at 11:53 AM

  2. 😀


    2007.07.28 at 08:42 PM

  3. Hi suniljagadish . i try to use your captcha but a it return a erro
    “Use of unassigned local variable ‘cgen'”
    i make this code:
    CaptchaGenerator cgen;

    Thank Man


    2007.09.11 at 11:02 PM

  4. Hi Bernardo, sorry it has been a while since I checked the commends. You should do a –
    cgen = new CaptchaGenerator(); before using cgen.

    Sunil Jagadish

    2007.12.15 at 12:49 AM

  5. test


    2010.12.21 at 04:14 AM

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: