Captcha image verification: in C#.net and asp.net [closed]
开发者_如何学Go
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this questionHow can I have Captcha image verification using asp.net forms?
A couple of things to look at:
- reCAPTCHA .NET library
- BotDetect
That was after a couple of minutes of searching - I'm sure you can find more.
I have used this one first: http://www.codeproject.com/KB/custom-controls/CaptchaControl.aspx
But I've had massive spam problems by bots. Using ReCaptcha works perfect so far.
this http://www.codeproject.com/KB/custom-controls/CaptchaControl.aspx will do great...
First of all Down load the MSCaptcha.dll from net import that dll in toolbar and also add references in your Bin folder In aspx file write the following Code
<cc1:CaptchaControl ID="CaptchaControl1" runat="server"
CaptchaBackgroundNoise="Low" CaptchaLength="6"
CaptchaHeight="60" CaptchaWidth="200"
CaptchaLineNoise="None" CaptchaMinTimeout="5"
CaptchaMaxTimeout="240" FontColor="#529E00"/>
<asp:Label ID="lbl" runat="server" Text="Verification Code *" style="display: inline-block;width: 200px;line-height: 1.8; vertical-align: top; font-size: 12px;font-weight:bold;"></asp:Label>
<asp:TextBox ID="txtcaptcha" runat="server" Height="22px" Width="325px" style="border: 1px solid #900;"></asp:TextBox>
and in code behind file write
CaptchaControl1.ValidateCaptcha(txtcaptcha.Text.Trim());
if (CaptchaControl1.UserValidated)
{
lbierror.ForeColor = System.Drawing.Color.Green;
lbierror.Text = "Valid";
}
else
{
lbierror.ForeColor = System.Drawing.Color.Red;
lbierror.Text = "InValid Captacha";
}
I hope this will work
精彩评论