A few days ago, I found a really cool CAPTCHA ASP.NET code sample. I converted it to VB.NET and repackaged it as a full blown ASP.NET server control:
It's as simple as I could make it: a total drag and drop, set the (three) properties and forget it implementation. The only tricky part was dealing with the dynamically generated image. You will have to add this HttpHandler section to your web.config file when you use the CaptchaControl
<httpHandlers>
<add verb="*" path="CaptchaImage.aspx"
type="WebControlCaptcha.CaptchaImageStream, WebControlCaptcha" />
</httpHandlers>
You can download the zipped VS.NET 2003 solution from my CodeProject article if you're interested. There are only two projects in the solution; an ultra simple demo website and the control library itself.
I should also mention that I tested this CAPTCHA against OCR software, specifically OmniPage Pro 14. It does suprisingly well for a couple key reasons-- low contrast, and all the characters are warped. It's possible to defeat it, but it's definitely not a trivial "drag to OCR window" situation. My kudos to BrainJar for coming up with this simple yet effective CAPTCHA.
Posted by Jeff Atwood View blog reactions
« Don't Devalue the Address Bar ASP.NET CAPTCHA control, improved »
Very nice!
Darrell on October 1, 2004 09:27 AMI developed one of these myself (in C#, however) and have it working on my site (link above).
brady gaster on October 4, 2004 09:07 AMBrady, very cool, although I suspect that is very OCR-able due to the high contrast and lack of warping. Probably doesn't matter since the effort bar has already been raised, but for the record ;)
I made another small improvement: I am using a HttpHandler instead of a HttpModule. That way I don't have to test every request for a page name.. the handler only fires for that one page.
There's also a great MSDN article on this topic here:
Jeff Atwood on October 10, 2004 04:45 PMCool stuff, thanks. I'm actually thinking of wrapping this up in a DotNetNuke module, if it's ok with you.
Burton on October 26, 2004 03:29 AMThe codeproject link doesn't work any more. Is there an updated Url?
mike h on March 29, 2005 08:49 AMSure, that's no problem. Scott Hanselman already included the CAPTCHA in his release of dasBlog as well.
Jeff Atwood on March 29, 2005 09:35 AMLooks like the MSDN URL has changed; I suspect it refers to this (very good) article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/hip_aspnet.asp
This is based upon the .NET 1.x framework.
Regards, Matt
Matt on September 14, 2006 11:45 AMFor me, I have found that the control doesn't work when it resides on a page that uses master pages. When the control is on a basic *.aspx page, it works fine. However, the site I want to use this with uses master pages. Can you help me to understand why that may be?? In laymen's terms as well. I am not a code guru.
Kemrex on November 10, 2007 11:24 PMI have solved my problem. There was a CSS conflict with my stylesheet and the styles applied to the DIV/SPAN elements within the control itself. It was also only an IE 6 bug as well. I stripped out all of the styles from your control and it worked with my stylesheet!
Kemrex on November 11, 2007 08:47 AMVery nice! and very helpful. I shall use it in my .net projects.
thanks
Nice work, Jefferson.
Why did you choose not to use it on codinghorror.com?
gunther on January 2, 2008 10:16 AMThe 2.0 project download on The Code Project is missing the CaptchaImage.aspx file.
9key on January 16, 2008 02:13 PM12w21w21
www on January 18, 2008 07:43 AMOne question and one comment...
First, great control! You saved me a ton of time. =)
Now, for the question...
I'm using your controlw ith a Template version of the Login control. Unfortunately, the control appears to not have any events that fire upon failure. I would to display a simple error to my user when they make a typo in the CAPTCHA.
Any thoughts or recommendations?
hk
hjk on February 25, 2008 03:08 AMdfhjkdhfjkdjkfdjkfjkhfkdf
.dfdhfjdjkf
f'djfhdjfjkd
dev astha shefalii arshi pawan
shefalii on March 1, 2008 04:29 AMHi,
It is a great control and i am using it in a project.
The only problem is sometime the CAPTCHA image can not be displayed and i have to re-start IIS.
Please help.
Thanks
Yu on March 5, 2008 03:46 AMcvzxvcxbv
xvcv on March 13, 2008 07:40 AManyone happen to have a C# version?
Tx..
where is source code of this control...
and runtime files...
Where's the source code? The link is broken!
9key on May 12, 2008 02:11 PMThere is an AJAX compatible version here: http://www.centrifugalbumblepuppy.com/posts/telerik-ajax-compatible-captcha-control.aspx
ajaxversion on June 9, 2008 05:00 AM| Content (c) 2008 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved. |