Next step of programming

Just another WordPress.com weblog

Captcha Control Sample (C#, ASP.NET, Server Control)

with 6 comments

In various websites, Captcha control is used for validating the user input and protect web application from the program. Here is one of the sample control for Captcha. It is basic one which can be enhanced further by including more to the image generation and even including the timeout. Or you can add much more to it

This application has two parts

1. CaptchaControl
2. CaptchaControl Sample Project

Captcha control has three files.

1. CaptchaControl (Which is the main control)
2. CaptchaImage (Which generates the Captcha image)
3. CaptchaImageHandler (which will provide the image to browser from the cache).

You can download it from (Captcha Control Sample)

Captcha Sample Control

Captcha Sample Control

Written by A.Sethi

February 26, 2009 at 4:17 am

Posted in ASP.NET, Controls

Tagged with , , , ,

6 Responses

Subscribe to comments with RSS.

  1. Hey, I didn’t get a chance to download your control. Is it case sensitive? How do you handle 0 vs O and stuff like that? I was curious because I was dealing with several captcha systems today (which inspired me to write this captcha complaint: http://dpatrickcaldwell.blogspot.com/2009/02/completely-automated-public-turing-test.html). I’ll probably just have to write my own.

    dpatrickcaldwell

    February 27, 2009 at 8:09 pm

    • No it is not case sensitive, since most of them out there are not case sensitive and it will be easy for user to just enter the characters, Also i haven’t included the characters like ( o,0, B, 8, 1, I). In order to handle the confusion.

      Also this is just a control to give an idea how it can be developed. It can be modified to extend like

      1. Transformation of characters
      2. Timeout for the captcha code to be entered
      3. Style applying.
      4. and level of noise etc

      The work of generation of image, applying it to the control, validation and server control is done in this sample
      anything else do reply :)

      A.Sethi

      March 2, 2009 at 3:46 am

  2. I saw your captcha complaint in your blog. I think those are perfect guidelines for developing captcha control for the developers. Even in this sample captcha control you will find most of them implemented. :)

    A.Sethi

    March 2, 2009 at 4:06 am

  3. I AM INDIVIDUAL AND WANT CAPTCHA WORK.
    CAN YOU HELP ME?

    THANKS

    ABDUL HAKEEM

    October 20, 2009 at 4:16 am

  4. I get a compile-time error from the following (and similar) lines.

    public int DrawHeight { get; set; }

    The error says to use abstract or extern.

    Any thoughts?
    Thanks

    Manjit

    October 29, 2009 at 5:58 am

    • This code i have written for framework 3.5 in VS2008 using automatic properties feature and not writing backing store for it. Are you doing this in framework 2.0 in VS2005. You can do it in framework 2.0 also but IDE should be VS2008

      A.Sethi

      November 4, 2009 at 5:35 am


Leave a Reply