You can use the captcha control in your website for the security purpose and also to check whether person is human or robot.
for that first of all download MSCaptcha.dll file.
Now insert that dll file into your toolbox by adding any new tab or inserting into the existing tab.
To use the captcha for your website:-
<add mscaptcha”="" path="”CaptchaImage.axd”" type="”MSCaptcha.CaptchaImageHandler," verb="”GET”">
There are various parameters like which you can set
CaptchBackgroundNoise – Sets the amount of Noise you want in background noise
CaptchaLength – Length of the Captcha Text
CaptchaHeight – Height of Captcha control
CaptchaWidth – Width of Captcha control
CaptchaLineNoise – Line Noise in image
CaptchaMinTimeout – Minimum Time Captcha image is valid
CaptchaMaxTimeout – Maximum Time Captcha image is valid
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”;
}
}
CaptchaBackgroundNoise – either “none”, “low”, “medium”, “high” or “extreme” – the amount of noise to add to the picture to make it harder for OCR (“optical character recognition”) software to recognize. Beware that this also affects how your users will be able to read and understand its content. So my recommendation is to set it to “none” and only increase the level if you’ll notice the presence of automatically registered bots on your site.
CaptchaLength – how many symbols captcha will contain. The recommended value is around 4-5, and you should increase it only if have a real problem with spammers.
CaptchaHeight and CaptchaWidth – the height and width (in pixels) of the generated image.
CaptchaLineNoise – adds lines to your image to further harden the OCR software work. The recommended starting value is “None”, although you can increase it later.
CaptchaMaximeout – timeout in seconds, after which your current captcha will become invalid. It is recommended to keep this value relatively high and refresh (using AJAX, for example) your captcha when it is about to become invalid.
CaptchaMinTimeout – minimal time period in seconds for filling the captcha response. This means – if you set the CaptchaLength to 5 seconds, any input entered in first 5 seconds after Captcha’s generation will be rejected.
CaptchaChars – the string of characters to be used for Captcha generation. The default is “ABCDEFGHJKLMNPQRSTUVWXYZ23456789″. We recommend to avoid using chars like O, 0, 1 and I because using different fonts they may confuse your users.
for that first of all download MSCaptcha.dll file.
Now insert that dll file into your toolbox by adding any new tab or inserting into the existing tab.
To use the captcha for your website:-
<add mscaptcha”="" path="”CaptchaImage.axd”" type="”MSCaptcha.CaptchaImageHandler," verb="”GET”">
There are various parameters like which you can set
CaptchBackgroundNoise – Sets the amount of Noise you want in background noise
CaptchaLength – Length of the Captcha Text
CaptchaHeight – Height of Captcha control
CaptchaWidth – Width of Captcha control
CaptchaLineNoise – Line Noise in image
CaptchaMinTimeout – Minimum Time Captcha image is valid
CaptchaMaxTimeout – Maximum Time Captcha image is valid
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”;
}
}
CaptchaBackgroundNoise – either “none”, “low”, “medium”, “high” or “extreme” – the amount of noise to add to the picture to make it harder for OCR (“optical character recognition”) software to recognize. Beware that this also affects how your users will be able to read and understand its content. So my recommendation is to set it to “none” and only increase the level if you’ll notice the presence of automatically registered bots on your site.
CaptchaLength – how many symbols captcha will contain. The recommended value is around 4-5, and you should increase it only if have a real problem with spammers.
CaptchaHeight and CaptchaWidth – the height and width (in pixels) of the generated image.
CaptchaLineNoise – adds lines to your image to further harden the OCR software work. The recommended starting value is “None”, although you can increase it later.
CaptchaMaximeout – timeout in seconds, after which your current captcha will become invalid. It is recommended to keep this value relatively high and refresh (using AJAX, for example) your captcha when it is about to become invalid.
CaptchaMinTimeout – minimal time period in seconds for filling the captcha response. This means – if you set the CaptchaLength to 5 seconds, any input entered in first 5 seconds after Captcha’s generation will be rejected.
CaptchaChars – the string of characters to be used for Captcha generation. The default is “ABCDEFGHJKLMNPQRSTUVWXYZ23456789″. We recommend to avoid using chars like O, 0, 1 and I because using different fonts they may confuse your users.
No comments:
Post a Comment