C# Класс Evbpc.Framework.Integrations.Google.ReCaptcha.Validator

This class provides the ability to easily implement Google's reCAPTCHA.
See: https://www.google.com/recaptcha/intro/index.html
Показать файл Открыть проект

Открытые методы

Метод Описание
GetBodyDivContent ( ) : string

Returns the <div> that should be inserted in the HTML where the reCAPTCHA should be rendered.

This method allows you to pass an arbitrary list of extra classes, regardless of what the current instance may contain.

Validate ( NameValueCollection form, string remoteIp = null ) : Response

Determines if the reCAPTCHA response in a NameValueCollection passed validation.

If the returned Response is null, then a severe error occurred during the exchange.

Validator ( string reCaptchaSecret, string reCaptchaSiteKey ) : System

Creates a new instance of the Validator.

Защищенные методы

Метод Описание
GetPostParameters ( string reCaptchaFormResponse, string remoteIp = null ) : NameValueCollection

Returns the parameters to be placed within the post body of a validation message.

UploadRecaptchaResponse ( NameValueCollection postParameters ) : string

Uploads a request to the Google API for reCAPTCHA data to be validated.

Описание методов

GetBodyDivContent() публичный Метод

Returns the <div> that should be inserted in the HTML where the reCAPTCHA should be rendered.
This method allows you to pass an arbitrary list of extra classes, regardless of what the current instance may contain.
public GetBodyDivContent ( ) : string
Результат string

GetPostParameters() защищенный Метод

Returns the parameters to be placed within the post body of a validation message.
protected GetPostParameters ( string reCaptchaFormResponse, string remoteIp = null ) : NameValueCollection
reCaptchaFormResponse string The response from the reCAPTCHA form.
remoteIp string An optional IP to include as the origin of the reCAPTCHA form.
Результат System.Collections.Specialized.NameValueCollection

UploadRecaptchaResponse() защищенный статический Метод

Uploads a request to the Google API for reCAPTCHA data to be validated.
protected static UploadRecaptchaResponse ( NameValueCollection postParameters ) : string
postParameters System.Collections.Specialized.NameValueCollection The parameters to send in the POST message.
Результат string

Validate() публичный Метод

Determines if the reCAPTCHA response in a NameValueCollection passed validation.
If the returned Response is null, then a severe error occurred during the exchange.
public Validate ( NameValueCollection form, string remoteIp = null ) : Response
form System.Collections.Specialized.NameValueCollection The Request.Form to validate.
remoteIp string An optional IPAddress
Результат Response

Validator() публичный Метод

Creates a new instance of the Validator.
public Validator ( string reCaptchaSecret, string reCaptchaSiteKey ) : System
reCaptchaSecret string The reCAPTCHA secret.
reCaptchaSiteKey string The reCAPTCHA site key.
Результат System