20/05/2014 by Nitesh

Options: Configure BotDetect Captcha on your website


In my last post I discussed how can you add captcha to your website in just 5 minutes. In this post, we will see what are the options 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!