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.
Very nice!
Darrell on October 1, 2004 10: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 10: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 5:45 AMThe codeproject link doesn't work any more. Is there an updated Url?
mike h on March 29, 2005 8: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 9: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 12:45 PMFor 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 AMI 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 8: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 2:13 AM12w21w21
www on January 18, 2008 7: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 3:08 AMdfhjkdhfjkdjkfdjkfjkhfkdf
.dfdhfjdjkf
f'djfhdjfjkd
dev astha shefalii arshi pawan
shefalii on March 1, 2008 4: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 3:46 AMcvzxvcxbv
xvcv on March 13, 2008 8: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 3:11 AMThere is an AJAX compatible version here: http://www.centrifugalbumblepuppy.com/posts/telerik-ajax-compatible-captcha-control.aspx
ajaxversion on June 9, 2008 6:00 AMdfgsdfg
ghj on July 30, 2008 1:23 PMdfg
dgd on September 3, 2008 1:24 PMsddsf
sdfds on October 7, 2008 2:24 AMHi, thanks for the article; in fact I used your render idea to integrate it into a fully featured control http://www.sharppieces.com/free-aspnet-controls/CaptchaImage.aspx. The control is open source on codeplex, check it out if you have time.
Alex Botez on October 20, 2008 12:43 PMTest
Test on February 23, 2009 4:14 AMhola a todos buen blog
Entrar a esteblog es interesante
this is a buen blog here a href=http://www.google.com.pe class=title-link for looking
Ernesto on March 11, 2009 9:24 AMFor windows vista, you have to add:
add name=CaptchaImage path=CaptchaImage.aspx verb=GET type=WebControlCaptcha.CaptchaImageHandler resourceType=Unspecified preCondition=integratedMode /
in handlers section.
Regards,
Asang Dani
Implementation of Custom web control to display CAPTCHA image can be found here:
http://etechplanet.com/post/2009/05/11/Create-CAPTCHA-Image-using-C-and-ASPNet.aspx
Avi on May 11, 2009 10:39 AMtest
Anonymous on June 8, 2009 7:59 AMCool stuff, thanks. I'm actually thinking of wrapping this up in a DotNetNuke module, if it's ok with you.
Burton on February 6, 2010 9:30 PMIf you want a simple Captcha in asp.net, check this article: http://www.massimilianobianchi.info/max/20art_A-simple-CAPTCHA-with-ASP-NET.aspx
Massimiliano Bianchi on April 20, 2011 12:49 AMThe comments to this entry are closed.
|
|
Traffic Stats |