How to Use and Implement Captcha Image
Here I explained How to Use and Implement Captcha Image in C#.Net coding with Captcha.dll.Captcha image used to protect web forms against spammers.Nowadays We can see this image lot of websites and Register form or signup form end of the submit the form. The Captcha Image generate alphanumeric charecters or numbers randomly.. Basically Captcha image used to protect web forms against spammers.
How to Use and Implement Captcha Image in C#.Net with captcha.dll
Captcha image used to protect web forms against spammers.Captcha Stands:
Completely
Automated
Public
Turing test to tell
Computers and
Humans
Apart
ie:Completely Automated Public Turing test to tell Computers and Humans ApartRelationship between Captcha & spam
Aspx Coding Sample:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="MSCaptcha" Namespace="MSCaptcha" TagPrefix="cc1" %>
<!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>Captcha Image </title>
</head>
<body>
<form id="form1" runat="server">
<div>
<cc1:CaptchaControl ID="CaptchaControl1" runat="server" Height="107px" />
<asp:TextBox ID="TxtCaptcha" runat="server">
</asp:TextBox>
<br />
<asp:Button ID="Captcha" runat="server" Text="Check" onclick="Captcha_Click" />
<br />
<br />
<asp:Label ID="LblCaptcha" runat="server">
</asp:Label>
</div>
</form>
</body>
</html>File Name:Defult.aspx.cs
using System;
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;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Captcha_Click(object sender, EventArgs e)
{
CaptchaControl1.ValidateCaptcha(TxtCaptcha.Text);
if (!CaptchaControl1.UserValidated)
{
LblCaptcha.Text = "You Entered Text Doesn't Match";
return;
}
else
{
LblCaptcha.Text = "Successfully Entered";
}
}
}In WebConfig File :
<add verb="GET" path="CaptchaImage.axd" type="MSCaptcha.CaptchaImageHandler, MSCaptcha"/>
I have attached Complete C# coding with output image
Hi
I'm using the profile system Membership In web.config
After Upload The Web Site This error happens :
Protected ReadOnly Property Profile() As ProfileCommon
Get
Return CType(Me.Context.Profile,ProfileCommon)
Please Help Me
Thanks