CAPTCHA Generator for .NET
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).
Usage
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
cgen.ResetCaptchaColor();
CaptchaText = cgen.GenerateCaptcha(@”G:\test1.gif”);
pictureBox1.ImageLocation = @”G:\test1.gif”;
😉
Sharath
2007.07.28 at 11:53 AM
😀
suniljagadish
2007.07.28 at 08:42 PM
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;
cgen.ResetCaptchaColor();
this.Response.Write(
cgen.GenerateCaptcha(@”E:\CTL\Imagenes\test1.gif”));
Thank Man
Bernardo
2007.09.11 at 11:02 PM
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
test
test
2010.12.21 at 04:14 AM