C# Class VisualCaptcha.Captcha

Afficher le fichier Open project: lukeautry/visualCaptcha-aspnet Class Usage Examples

Méthodes publiques

Свойство Type Description
PossibleImageOptions string>.ImmutableDictionary
ValidAudioOption string>.KeyValuePair
ValidImageOption string>.KeyValuePair

Méthodes publiques

Méthode Description
Captcha ( int numberOfImageOptions ) : System

Instantiate a Captcha session with an assortment of possible image selections and an audio option for accessibility

GetAudio ( string type ) : byte[]

Get file content for audio Captcha option

GetFrontEndData ( ) : FrontEndData

Retrieve object containing information needed by client-side library

GetImage ( int index, bool isRetina ) : byte[]

Get file content for image Captcha option

ValidateAnswer ( string answerValue ) : bool

Answer value is valid for either image or audio option

Private Methods

Méthode Description
GetRandomImageOptions ( int numberOfOptions ) : string>.ImmutableDictionary
GetRandomOption ( string>.ICollection options ) : string>.KeyValuePair
IsValidAudio ( string value ) : bool
IsValidImage ( string hashedPath ) : bool
ReadResource ( string optionPath ) : byte[]

Method Details

Captcha() public méthode

Instantiate a Captcha session with an assortment of possible image selections and an audio option for accessibility
public Captcha ( int numberOfImageOptions ) : System
numberOfImageOptions int
Résultat System

GetAudio() public méthode

Get file content for audio Captcha option
public GetAudio ( string type ) : byte[]
type string Either mp3 or ogg
Résultat byte[]

GetFrontEndData() public méthode

Retrieve object containing information needed by client-side library
public GetFrontEndData ( ) : FrontEndData
Résultat FrontEndData

GetImage() public méthode

Get file content for image Captcha option
public GetImage ( int index, bool isRetina ) : byte[]
index int Image index
isRetina bool Uses Retina display
Résultat byte[]

ValidateAnswer() public méthode

Answer value is valid for either image or audio option
public ValidateAnswer ( string answerValue ) : bool
answerValue string This could be the hashed value of the image path or the answer to an audio question
Résultat bool

Property Details

PossibleImageOptions public_oe property

Dictionary of possible images to be displayed client-side Key: The image name (e.g. "Cloud") Value: The hashed value of the image path (e.g. "Cloud.png" --> "198723lkdjlfiwoekjdlsd")
public ImmutableDictionary PossibleImageOptions
Résultat string>.ImmutableDictionary

ValidAudioOption public_oe property

The correct question/answer pair for audio accessibility option
public KeyValuePair ValidAudioOption
Résultat string>.KeyValuePair

ValidImageOption public_oe property

The correct selection out of the options contained in PossibleImageOptions
public KeyValuePair ValidImageOption
Résultat string>.KeyValuePair