Class wwWebCaptcha

The CAPTCHA control can be used on a form to validate user input to increase the likelyhood that the page is filled by a live human as opposed to a robot or HTTP client. The control displays an image with a code that needs to be manually typed in to match and validate the request.

Using the control is as easy as dropping the control on a form, setting up the characters that it should display and a length of the string and font infomration. The control will then render the image for you as a separately loaded image. The image and text is rendered automatically.

To validate the input of the control you can check the IsValidated property which is true only if the user entered the correct code. Based on the result you can accept or fail the form submission.

wwWebControl
  wwWebCaptcha

Remarks

Requires wwImage.dll library.

This control uses Session to store the generated ID. Requires that EnableSessionState is true on the page or the InitSession is called in the Process class.

Class Members

MemberDescription

SubmitCaptcha

Generates the Captcha value from the CaptchaChars and submits the Captcha value to Session state. This method is automatically called by the control when running in Web Control Framework page. If running in a Process method you should call this manually.

o.wwWebCaptcha.SubmitCaptcha()

ValidateCaptcha

Checks to see if the Captcha code entered valid. This is automatically called in Web Control pages. For Process methods you can call this method to check validity.

o.wwWebCaptcha.ValidateCaptcha()

CaptchaLength

Number of characters to display

CapthaChars

The characters that are used to make up the CAPTCHA expression displayed. The default is all uppercase letters and numbers except 0 and O. You can use any characters you chose.

FontName

The font used for the CAPTCHA image

FontSize

The size of the font

IsValidated

Determines whether the correct code was entered

Text

Text displayed next to the CAPTCHA display

Requirements

Assembly: webcontrolsextended.prg

© West Wind Technologies, 1996-2024 • Updated: 01/20/14
Comment or report problem with topic