By using recaptcha you can protect your web side from bot:
For using recaptcha in your web site you have need to download Recaptcha.dll from
After that add DLL as a reference as url website.
You can get your public key and private key from
http://www.google.com/recaptcha
here my page name was captcha.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Captcha.aspx.cs" Inherits="Captcha" %>
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<recaptcha:RecaptchaControl
ID="recaptcha"
runat="server"
PublicKey="XXXXXXXXXX"
PrivateKey="XXXXXXXXXX"
/>
<div>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
</div>
</form>
</body>
</html>
Server side code for captcha.aspx is:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Recaptcha;
public partial class Captcha : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
//True Conditon
}
else
{
//False Condition
}
}
}
For more information gone through following URL:
http://code.google.com/apis/recaptcha/docs/aspnet.html
Njoy buddy...:)
For using recaptcha in your web site you have need to download Recaptcha.dll from
After that add DLL as a reference as url website.
You can get your public key and private key from
http://www.google.com/recaptcha
here my page name was captcha.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Captcha.aspx.cs" Inherits="Captcha" %>
<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<recaptcha:RecaptchaControl
ID="recaptcha"
runat="server"
PublicKey="XXXXXXXXXX"
PrivateKey="XXXXXXXXXX"
/>
<div>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
</div>
</form>
</body>
</html>
Server side code for captcha.aspx is:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Recaptcha;
public partial class Captcha : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
//True Conditon
}
else
{
//False Condition
}
}
}
For more information gone through following URL:
http://code.google.com/apis/recaptcha/docs/aspnet.html
Njoy buddy...:)
No comments:
Post a Comment