In my last post, I discussed how you can add captcha to your website in just 5 minutes. In this post, we will see what options are available for you to customize the captcha. BotDetect provides a long set of options to customize your captcha. Few of the options are listed below:
- Locale – You can set the locale of the characters seen in captcha to different locales such as:
- en-CA
- en-US
- en-UK
- es
- en-IN
- hi – For displaying Captcha in Hindi
- he – For hebrew characters
CodeLength
– The number of characters displayed in the Captcha Image. The range is between 1 to 15 characters and the default value is 4-6. CodeStyle
– This property allows you to display alphanumeric, alphabet only or numeric only captchas. Valid values are:
Alphanumeric
Numeric
Alpha
ImageStyle
– BotDetect provides more than 50 different styles of the characters displayed in captcha. Some of them are:
Bubbles
Bullet
Chess
Collage
Corrosion
Darts
Distortion
FingerPrints
Wave
ImageFormat
– The format of the image rendered on the website for captcha. Valid values are Jpeg, Png, Gif & Bmp ImageSize
– The size of the image SoundStyle
– Type of sound played on clicking the Sound button beside the captcha. You can choose from a set of 10 predefined sound tracks
Below is a sample code that applies the above properties to a captcha control named “captchaBox
”.
captchaBox.Locale = "en-US";
captchaBox.CodeLength = 4;
captchaBox.CodeStyle = BotDetect.CodeStyle.Alphanumeric;
captchaBox.ImageStyle = BotDetect.ImageStyle.Fingerprints;
captchaBox.ImageFormat = BotDetect.ImageFormat.Png;
captchaBox.ImageSize = new System.Drawing.Size(275, 50);
captchaBox.SoundStyle = BotDetect.SoundStyle.Radio;
Click here for a full featured demo. Keep learning and sharing! Cheers!
A passionate developer with over 10 years of experience and building my software company code by code. Experience withMS Technologies like .Net | MVC | Xamarin | Sharepoint | MS Project Server and PhP along with open source CMS Systems like Wordpress/DotNetNuke etc.
Love to debug problems and solve them. I love writing articles on my website in my spare time. Please visit my Website for more details and subscribe to get technology related tips/tricks. #SOreadytohelp