New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

RadCaptcha image generation class

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class CaptchaImage

Inheritance: objectCaptchaImage

Inherited Members object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

Creates an instance of the CaptchaImage class.

C#
public CaptchaImage()

Creates an instance of the CaptchaImage class.

C#
[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)
Parameters:oldImageCaptchaImage

The old CaptchaImage object.

rndRandom

An instance of the Random class.

generatedDateTime

The date and time the CaptchaImage was rendered.

uniqueGuidstring

A GUID that uniquely identifies the CaptchaImage.

Creates an instance of the CaptchaImage class.

C#
public CaptchaImage(CaptchaImage oldImage, TelerikRandom rnd, DateTime generated, string uniqueGuid)
Parameters:oldImageCaptchaImage

The old CaptchaImage object.

rndTelerikRandom

An instance of the TelerikRandom class.

generatedDateTime

The date and time the CaptchaImage was rendered.

uniqueGuidstring

A 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.

C#
public string AudioFilesPath { get; set; }
Property Value:

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.

C#
public Color BackgroundColor { get; set; }
Property Value:

The background color of the CaptchaImage.

Gets or sets the amount of background noise to generate in the RadCaptcha image.

C#
public CaptchaBackgroundNoiseLevel BackgroundNoise { get; set; }
Property Value:

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.

C#
public string CharSet { get; set; }
Property Value:

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.

C#
public bool EnableAudioNoise { get; set; }

Gets or sets the bool value indicating whether the CaptchaAudio will be enabled.

C#
public bool EnableCaptchaAudio { get; set; }
Property Value:

Gets or sets the bool value indicating whether the CaptchaAudio will be enabled.

Gets or sets the font used to render RadCaptcha text.

C#
public string FontFamily { get; set; }
Property Value:

The name of the font used to render RadCaptcha text.

Gets or sets the amount of random font warping used on the RadCaptcha text.

C#
public CaptchaFontWarpFactor FontWarp { get; set; }
Property Value:

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.

C#
public string FontWhitelist { get; set; }

Gets or sets the height of the RadCaptcha image.

C#
public int Height { get; set; }
Property Value:

The height of the RadCaptcha image.

Gets or sets the RadCaptcha image alternative text.

C#
public string ImageAlternativeText { get; set; }
Property Value:

The RadCaptcha image alternative text.

Gets or sets the RadCaptcha image CSS class.

C#
public string ImageCssClass { get; set; }
Property Value:

The RadCaptcha image CSS class.

Gets or sets the line noise level to the RadCaptcha image.

C#
public CaptchaLineNoiseLevel LineNoise { get; set; }
Property Value:

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.

C#
public bool PersistCodeDuringAjax { get; set; }

Gets the previous text of the CaptchaImage.

C#
public string PreviousText { get; }

Gets the date and time this image was last rendered

C#
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).

C#
public bool RenderImageOnly { get; set; }
Property Value:

Bool value indicating whether the RadCaptcha will only be rendered on the page.

Gets the randomly generated RadCaptcha text.

C#
public string Text { get; }

Gets or sets the characters used to render RadCaptcha text. A character will be picked randomly from the string.

C#
public CaptchaPossibleChars TextChars { get; set; }
Property Value:

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.

C#
public Color TextColor { get; set; }
Property Value:

The color of the RadCaptcha text.

Gets or sets the number of CaptchaChars used in the RadCaptcha text.

C#
public int TextLength { get; set; }
Property Value:

Number of CaptchaChars used in the RadCaptcha text.

Gets a GUID that uniquely identifies this CaptchaImage

C#
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.

C#
public bool UseAudioFiles { get; set; }
Property Value:

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.

C#
public bool UseRandomFont { get; set; }
Property Value:

Bool value indicating whether a random font will be used to generate the CaptchaImage text.

Gets or sets the width of the RadCaptcha image.

C#
public int Width { get; set; }
Property Value:

The width of the RadCaptcha image.

Methods

Generates a new RadCaptcha code.

C#
public void GenerateCode()

Generates a new RadCaptcha code.

C#
public void GenerateCode(bool filterWords)
Parameters:filterWordsbool

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.

C#
public Bitmap RenderImage()
Returns:

Bitmap