Saturday, 16 March 2013

[VB6] Create Captcha in VB6

Concept 
The basic thing we are goin' to do is the following steps:
1) Generating Random characters.
2)Printing them in a picture box.
3) Making them scratched.


(1)Generating Random Characters 
 NOTE:Make sure that you write "Randomize" Command in the form_load event.





Explanation : Fck 1,2,3 and 4 are variables for storing ascii code of the character which is generated randomly.
65 to 91 is the ascii code of Capital A-Z
97 to 123 is ascii code of Small(lower case) a-z so,

gen1 will contain a FOUR letter word. This we are using for checking purposes
generated1 is the text to be shown in the picture box...(its used because spaces look nice)

(2)Printing in Picture Box



(3)Making them scratched(using lines)

 


Explanation : In the variables a1234, b1234, z1234,x1234,y1234 we are genrating a number between 1 to 3000(Because 3000x3000 is dimension of picture box). These are the req. coordinates.

Now we just simply print the lines in the the picture box with these coordinates.
NOTE : To increase the intensity of lines, just increase the upper bound of loop.
The result printed will be Four letters with some(or more) scratches, hardly readable.

Validation Part

 

Resource Program Here

2 comments:

  1. splendid!!!this is so informative.thanks for sharing this code.i gonna give a try in VB6.keep blogging.

    captcha solver

    ReplyDelete
  2. wow!!the great blog.it is very informative and useful.
    thanks for sharing the information.
    keep blogging.

    deathbycaptcha

    ReplyDelete