Click here to Skip to main content
15,942,710 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can somebody please assist me, i am building a personal asp.net web application
in C# and i want to include a Captcha.I have decided to use a number sequence, as in "2,4,_,8". The user must fill in the missing value. Also, the placeholder must change on each attempt. I also want the Captcha to monitor unsuccessful IP(i.e Flag them). Thanks in advance
Posted
Updated 29-Sep-11 7:26am
v3

there is already a ASP.NET server control for this called MScaptcha. its a free control. You can download its dll from the following site

http://www.mondor.org/captcha.aspx[^]


You will get proper documentation, regarding how to use it.

Still for youe help, belowgiven are brief steps how to implement it.

Download the dll and add its refrence to your project and then do the following.

XML
//Web.config

      <httpHandlers>
<add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>

            </httpHandlers>


//In  Aspx page or in user control

<%@ Register Assembly="MSCaptcha"Namespace="MSCaptcha" TagPrefix="cc1" %>

<cc1:CaptchaControl ID="ccJoin" runat="server" CaptchaBackgroundNoise="none" CaptchaLength="5" CaptchaHeight="60" CaptchaWidth="200" CaptchaLineNoise="None" CaptchaMinTimeout="5" CaptchaMaxTimeout="240" />


///C# Code

Button click event

  ccJoin.ValidateCaptcha(txtcaptchatext.Text.Trim());

  if (ccJoin.UserValidated)
        {
//submit form
  }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900