ASP.NET CAPTCHA: Lanap.BotDetect.Captcha Class
This class is an ASP.NET Custom Web Control that creates and validates image and sound CAPTCHAs.
Public Instance Constructors
Captcha()
Initialize a new instance of the Lanap.BotDetect.Captcha class.
Public Instance Properties
CaptchaImageAltText
Custom alt text of the CAPTCHA image. The default alt text used is "CAPTCHA code image".
CodeLength
Length (number of characters) of the random code used for CAPTCHA generation. The default length is 5 characters.
CodeType
The type of random code used for CAPTCHA generation. Valid values are members of the CodeTypeEnum Enumeration. The default value is CodeTypeEnum.AlphaNumeric.
ImageEnabled
A flag indicating should the CAPTCHA image be rendered. True by deafult.
ImageFormat
The image format in which CAPTCHA images will be rendered. Valid values are members of the ImageFormatEnum Enumeration. The default value is ImageFormatEnum.Jpeg.
ImageSize
Size of the CAPTCHA image rendered (in pixels). The default value is (250, 50).
ReloadEnabled
A flag indicating should the image reload button be rendered with the control. True by deafult.
ReloadIconAltText
Custom alt text of the CAPTCHA reload icon. The default alt text used is "Change the code".
SoundEnabled
A flag indicating should the link to the audio CAPTCHA be rendered with the control. True by deafult.
SoundIconAltText
Custom alt text of the CAPTCHA sound icon. The default alt text used is "Speak the code".
TextStyle
The text style (distortion algorithm) used for CAPTCHA image generation. Valid values are members of the TextStyleEnum Enumeration. The default value is TextStyleEnum.Chalkboard.
Public Instance Methods
Validate(string code)
Compares the code sent by argument with the code used to generate the CAPTCHA instance that is being validated.
Public Static Methods
Validate(string code, string captchaID, string instanceID)
A static variant of the Validate method, allowing easier integration with various Ajax and MVC frameworks.