CaptchaImage
RadCaptcha image generation class
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class CaptchaImage
Inheritance: objectCaptchaImage
Inherited Members
Constructors
Creates an instance of the CaptchaImage class.
public CaptchaImage()
Creates an instance of the CaptchaImage class.
[Obsolete("Please use the other public constructor with TelerikRandom instead of Random as the second parameter")]
public CaptchaImage(CaptchaImage oldImage, Random rnd, DateTime generated, string uniqueGuid)
The old CaptchaImage object.
rndRandomAn instance of the Random class.
generatedDateTimeThe date and time the CaptchaImage was rendered.
uniqueGuidstringA GUID that uniquely identifies the CaptchaImage.
Creates an instance of the CaptchaImage class.
public CaptchaImage(CaptchaImage oldImage, TelerikRandom rnd, DateTime generated, string uniqueGuid)
The old CaptchaImage object.
rndTelerikRandomAn instance of the TelerikRandom class.
generatedDateTimeThe date and time the CaptchaImage was rendered.
uniqueGuidstringA GUID that uniquely identifies the CaptchaImage.
Properties
Gets or sets the path to the directory where the audio (.wav) files are located. The default value is ~/App_Data/RadCaptcha.
public string AudioFilesPath { get; set; }
The path to the directory where the audio (.wav) files are located.
Use the AudioFilesPath property to specify the directory where the audio (*.wav) files are located, and from which the audio code is generated. The audio files must be named "[Char]".wav (i.e. A.wav, B.wav, C.wav, 1.wav, 2.wav) and should contain the audio that corresponds to the specific character. Place the RadCaptcha folder (provided with the installation) in the App_Data directory of your WebSite.
Gets or sets the background color of the CaptchaImage.
public Color BackgroundColor { get; set; }
The background color of the CaptchaImage.
Gets or sets the amount of background noise to generate in the RadCaptcha image.
public CaptchaBackgroundNoiseLevel BackgroundNoise { get; set; }
The amount of background noise to generate in the RadCaptcha image.
Gets or sets a custom Character Set, from which the characters used to render RadCaptcha, are randomly chosen. The TextChars property must be set to CustomCharSet.
public string CharSet { get; set; }
The custom characters used to RadCaptcha text. A character will be picked randomly from the string.
Gets or sets a boolean value indicating whether a noise should be added to the CaptchaAudio.
public bool EnableAudioNoise { get; set; }
Gets or sets the bool value indicating whether the CaptchaAudio will be enabled.
public bool EnableCaptchaAudio { get; set; }
Gets or sets the bool value indicating whether the CaptchaAudio will be enabled.
Gets or sets the font used to render RadCaptcha text.
public string FontFamily { get; set; }
The name of the font used to render RadCaptcha text.
Gets or sets the amount of random font warping used on the RadCaptcha text.
public CaptchaFontWarpFactor FontWarp { get; set; }
The amount of random font warping used on the RadCaptcha text.
Gets or sets a semicolon-delimited list of valid fonts to use when no font is provided.
public string FontWhitelist { get; set; }
Gets or sets the height of the RadCaptcha image.
public int Height { get; set; }
The height of the RadCaptcha image.
Gets or sets the RadCaptcha image alternative text.
public string ImageAlternativeText { get; set; }
The RadCaptcha image alternative text.
Gets or sets the RadCaptcha image CSS class.
public string ImageCssClass { get; set; }
The RadCaptcha image CSS class.
Gets or sets the line noise level to the RadCaptcha image.
public CaptchaLineNoiseLevel LineNoise { get; set; }
The line noise level to the RadCaptcha image.
Gets or sets a bool value that indicates whether or not the Captcha will persist the code during Ajax requests that do not affect the RadCaptcha control. The default is false, which means a new code will be generated on every trip to the server (no matter if full or partial postback). Note: This property is useful when there is another Ajax panel on the page that does not update the Captcha. Setting it to true will cause the RadCaptcha control to persist its code during the Ajax requests.
public bool PersistCodeDuringAjax { get; set; }
Gets the previous text of the CaptchaImage.
public string PreviousText { get; }
Gets the date and time this image was last rendered
public DateTime RenderedAt { get; }
Gets or sets bool value that indicates whether the RadCaptcha Image will only be rendered on the page (without the textbox and Label).
public bool RenderImageOnly { get; set; }
Bool value indicating whether the RadCaptcha will only be rendered on the page.
Gets or sets the characters used to render RadCaptcha text. A character will be picked randomly from the string.
public CaptchaPossibleChars TextChars { get; set; }
The characters used to render RadCaptcha text. A character will be picked randomly from the string.
Gets or sets the color of the RadCaptcha text.
public Color TextColor { get; set; }
The color of the RadCaptcha text.
Gets or sets the number of CaptchaChars used in the RadCaptcha text.
public int TextLength { get; set; }
Number of CaptchaChars used in the RadCaptcha text.
Gets a GUID that uniquely identifies this CaptchaImage
public string UniqueId { get; }
Gets or sets a bool value indicating whether the audio code will be generated by concatenation of the audio files from a given folder.
public bool UseAudioFiles { get; set; }
The bool value indicating whether the audio code will be generated by concatenation of the audio files from a given folder.
Gets or sets a bool value indicating whether a random font will be used to generate the CaptchaImage text.
public bool UseRandomFont { get; set; }
Bool value indicating whether a random font will be used to generate the CaptchaImage text.
Methods
Generates a new RadCaptcha code.
public void GenerateCode()
Generates a new RadCaptcha code.
public void GenerateCode(bool filterWords)
Bool value that indicates whether or not bad words will be filtered. RadCaptcha has a built-in list of words that should not appear on the image.
Forces a new Captcha image to be generated using current property value settings.