That the internet is flooded with spam is no news to everyone. Most of it is automated – and so smart people came out with a notion of CAPTCHA: “Completely Automated Public Turing test to tell Computers and Humans Apart.”
I decided to do my own captcha implementation, just for the fun of it. There are far more complicated and better CAPTCHA solutions, reCAPTCHA is probably most widely used.
The only thing that sets my solution apart a bit is the simplicity of its use. Tiny fast 6KB .NET dll, which can be called with just “new NetCapctha(“swordfish”).GenerateImage()” and results a Bitmap that can be saved, manipulated further or streamed to the web page.
However, there are few more constructors for more control:
In case of last two constructors, I’d really recommend using overloaded public Bitmap GenerateImage(out string captchaText) method, as otherwise you won’t get the random string and the whole idea of having a CAPTCHA becomes somewhat moot…
Together with the CAPTCHA, there is a simple WinForms test project in the archive – which allows you to experiment with netCaptcha and see if it is suitable for your needs – or just find best settings for your website.
Same as all my utils, this is copyleft and free to use everywhere. However, it would be nice if you’d tell me that you have used netCaptcha somewhere. Also, you probably will want to recompile NetCaptcha.dll and sign it with a strong key.