Using Image characters verification to register a user on a web site.
Author: DevASP Download Source Code : 654_ImageVarification.zip
This article is about how you can verify image characters while registering a user to your web site.
This is same as when you make a new account on a mail server like yahoo or hotmail, while you are entering your information you are asked to enter the characters shown in the image. Note that these characters are generated randomly. This is to verify the user for registration. This is necessary because some one may send a hell of request to your server so that to slow down the speed of your server by increasing the requests and making the size of your database large and large by entering more and more registration information. You will be surprised how some one can do this. Note that this can be done using JavaScript that will submit the form again and again. But if you use image verification no one can do because system can not read the image itself and enter the characters into the text box.
Steps you will do.
Start visual studio and create a new web application.
Add new class in your project form the project menu and add the following code to randomly generate the image. Note that the image will be save temporary into your project directory.
Import the following namespaces in your class.
Add the following functions in your class.
Now come to your web form and drop a image control on the form.
Drop a label and set its following properties.
Drop a text box control and set its following properties.
Finally drop a button control and set its following properties.
Open the code window for the form and write the following code in the load event of the page.
Write following code in the click event of the check button to check weather the entered characters
match to the character in the image or not if the characters match then display a success message
otherwise a failed message.
Run your application and enter the characters shown in the image and click the check button to verify the characters.
|