ReCaptchaClient

Client which handles all ReCaptcha verifications.

Type: Class
Namespace: ReCaptcha.Desktop.WinForms.Client
Assembly: ReCaptcha.Desktop.WinForms
Inherits from: IReCaptchaClient

public class ReCaptchaBase : IReCaptchaBase

Constructors

Creates a new ReCaptchaClient.

public ReCaptchaClient(
    ReCaptchaConfig configuration,
    FormConfig formConfiguration)
ParameterDescription
ReCaptchaConfig configurationThe configuration the ReCaptchaClient should be created with.
FormConfig formConfigurationThe configuration the reCAPTCHA form will be created with.

Creates a new ReCaptchaClient with extendended logging functions

public ReCaptchaClient(
    ReCaptchaConfig configuration,
    FormConfig formConfiguration,
    ILogger<IReCaptchaClient> logger)
ParameterDescription
ReCaptchaConfig configurationThe configuration the ReCaptchaClient should be created with.
FormConfig formConfigurationThe configuration the reCAPTCHA form will be created with.
ILogger<IReCaptchaClient> loggerA logger from Dependency Injection with MVVM.

Properties

Configuration

The configuration used for this client.

Type: ReCaptchaConfig
Modifier: none
Default Value: none

FormConfiguration

The form configuration used for this client.

Type: FormConfig
Modifier: none
Default Value: none

VerificationRecieved

Fires when verifcation was recieved.

Type: EventHandler<VerificationRecievedEventArgs>?
Modifier: event

VerificationCancelled

Fires when verifcation was cancelled.

Type: EventHandler<VerificationCancelledEventArgs>?
Modifier: event

ReCaptchaResized

Fires when verifcation was cancelled.

Type: EventHandler<ReCaptchaResizedEventArgs>?
Modifier: event

Methods

VerifyAsync

Sets up the reCAPTCHA site and opens a new window for the user to verify.

Returns: A Google reCAPTCHA token.

Task<string> VerifyAsync(
    CancellationToken cancellationToken = default!)
ParameterDescription
CancellationToken cancellationTokenThe token to cancel this action.