Generates a CAPTCHA test that is based on the reCAPTCHA service.
Assembly: Microsoft.Web.Helpers (in Microsoft.Web.Helpers.dll)
Thetype exposes the following members.
This class represents a helper, which is a component that simplifies Web programming in ASP.NET Web Pages. You can use the class to help protect against malicious computer programs that make automated attacks on Web sites. The class generates a CAPTCHA, which is a test that checks user input based on the reCAPTCHA service. To use the service, you must register at the reCAPTCHA Web site (http://www.recaptcha.net) and obtain public and private keys.
A CAPTCHA test validates that user input is submitted by a human rather than a computer program. This helps prevent typical automated attacks such as adding spam comments to blogs or forums, or creating false user accounts on Web sites. A typical CAPTCHA test generates random text in the form of a distorted graphic image, which humans can read but computer programs cannot. If users correctly submit the randomly generated text shown in the distorted image, the CAPTCHA validates them.
To use the class to help protect your Web site against automated attacks, use the following steps at the points where the code validates user input (such as when it creates a new account or logs in a user):
Render the reCAPTCHA control. This is the form that displays a graphic image of words and prompts users to submit the correct text values. Call the GetHtml(String, String, String, Int32) method or the GetHtmlWithOptions(String, Object) method to render the reCAPTCHA control.
Validate the user input. Call the Validate(String) method to verify that the input passes the CAPTCHA test. If the method returns true, the code can allow the user to continue. If the method returns false, the code can take another action such as notifying the user that the input was incorrect and prompting the user to try again.