Here we discuss about how to create Captcha using DLL

.aspx File

<%@ Register Assembly=โ€MSCaptchaโ€ Namespace=โ€MSCaptchaโ€ TagPrefix=โ€cc1โ€ณ %>

<form id=โ€form1โ€ณ runat=โ€serverโ€>
<div>
<cc1:CaptchaControl ID=โ€Captcha1โ€ณ runat=โ€serverโ€
CaptchaBackgroundNoise=โ€Lowโ€ CaptchaLength=โ€5โ€ณ
CaptchaHeight=โ€60โ€ณ CaptchaWidth=โ€200โ€ณ
CaptchaLineNoise=โ€Noneโ€ CaptchaMinTimeout=โ€5โ€ณ
CaptchaMaxTimeout=โ€240โ€ณ FontColor = โ€œ#529E00โ€ณ />
</div>
<asp:TextBox ID=โ€txtCaptchaโ€ runat=โ€serverโ€></asp:TextBox>
<br />
<asp:Button ID=โ€btnVerifyโ€ runat=โ€serverโ€ Text=โ€Verifyโ€ OnClick=โ€btnVerify_Clickโ€ />
<asp:RequiredFieldValidator ID=โ€RequiredFieldValidator1โ€ณ runat=โ€serverโ€ ErrorMessage=โ€*Requiredโ€ ControlToValidate = โ€œtxtCaptchaโ€></asp:RequiredFieldValidator>
<br />
<br />
<asp:Label ID=โ€lblMessageโ€ runat=โ€serverโ€ Font-Names = โ€œArialโ€ Text=โ€”></asp:Label>
</form>

CodeBehind File

protected void btnVerify_Click(object sender, EventArgs e)
{
Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
if (Captcha1.UserValidated)
{
lblMessage.ForeColor = System.Drawing.Color.Green;
lblMessage.Text = โ€œValidโ€;
}
else
{
lblMessage.ForeColor = System.Drawing.Color.Red;
lblMessage.Text = โ€œInValidโ€;
}
}

Note : Download .dll here