No component generates verification code-BMP format
Call com_creatvalidcode ("validcode ")
Sub com_creatvalidcode (PSN)
'Author: layen
'Qq: 84815733
'E-mail: support@ssaw.NET
'Prohibit caching
Response. expires =-9999
Response. addheader "Pragma", "No-Cache"
Response. addheader "cache-ctrol", "No-Cache"
Response. contenttype = "image/BMP"
Randomize
Dim I, II, III
Const codds = 8' probability of occurrence of miscellaneous
Const camount = 36' text count
Const cCode = "0123456789 abcdefghijklmnopqrstuvwxyz"
'Color data (character, background)
Dim vcolordata (1)
Vcolordata (0) = chrb (0) & chrb (0) & chrb (0) 'Blue 0, green 0, red 0 (black)
Vcolordata (1) = chrb (250) & chrb (236) & chrb (211) 'Blue 250, green 236, red 211 (light blue)
'Randomly generated characters
Dim vcode (4), vcodes
For I = 0 to 3
Vcode (I) = int (RND * camount)
Vcodes = vcodes & Mid (cCode, vcode (I) + 1, 1)
Next
Session (PSN) = vcodes 'record the session
'Character data
Dim vnumberdata (35)
Vnumberdata (0) = "1110000111110111101111011110111101001011110100101111"
010010111101001011110111101111011110111110000111"
Vnumberdata (1) = "1111011111110001111111110111111111011111111101111111"
110111111111011111111101111111110111111100000111"
Vnumberdata (2) = "1110000111110111101111011110111111111011111111011111"
111011111111011111111011111111011110111100000011"
Vnumberdata (3) = "1110000111110111101111011110111111110111111100111111"
111101111111111011110111101111011110111110000111"
Vnumberdata (4) = "1111101111111110111111110011111110101111110110111111"
011011111100000011111110111111111011111111000011"
Vnumberdata (5) = "1100000011110111111111011111111101000111110011101111"
111110111111111011110111101111011110111110000111"
Vnumberdata (6) = "1111000111111011101111011111111101111111110100011111"
001110111101111011110111101111011110111110000111"
Vnumberdata (7) = "1100000011110111011111011101111111101111111110111111"
110111111111011111111101111111110111111111011111"
Vnumberdata (8) = "1110000111110111101111011110111101111011111000011111"
101101111101111011110111101111011110111110000111"
Vnumberdata (9) = "1110001111110111011111011110111101111011110111001111"
100010111111111011111111101111011101111110001111"
Vnumberdata (10) = "1111011111111101111111101011111110101111111010111111"
101011111100000111110111011111011101111000100011"
Vnumberdata (11) = "1000000111110111101111011110111101110111110000111111"
011101111101111011110111101111011110111000000111"
Vnumberdata (12) = "1110000011110111101110111110111011111111101111111110"
111111111011111111101111101111011101111110001111"
Vnumberdata (13) = "10000011111101110111110111101111011110111101111011110"
11110111101111011110111101111011101111000001111"
Vnumberdata (14) = "10000001111101111011110110111111011011111100001111110"
11011111101101111110111111111011110111000000111"
Vnumberdata (15) = "10000001111101111011110110111111011011111100001111110"
11011111101101111110111111111011111111000111111"
Vnumberdata (16) = "11100001111101110111101111011110111111111011111111101"
11111111011100011101111011111011101111110001111"
Vnumberdata (17) = "10001000111101110111110111011111011101111100000111110"
11101111101110111110111011111011101111000100011"
Vnumberdata (18) = "11000001111111011111111101111111110111111111011111111"
10111111111011111111101111111110111111100000111"
Vnumberdata (19) = "11100000111111101111111110111111111011111111101111111"
11011111111101111111110111110111011111000011111"
Vnumberdata (20) = "10001000111101110111110110111111010111111100011111110"
10111111101101111110110111111011101111000100011"
Vnumberdata (21) = "10001111111101111111110111111111011111111101111111110"
11111111101111111110111111111011110111000000011"
Vnumberdata (22) = "10001000111100100111110010011111001001111101010111110"
10101111101010111110101011111010101111001010011"
Vnumberdata (23) = "10001000111100110111110011011111010101111101010111110"
10101111101100111110110011111011001111000110111"
Vnumberdata (24) = "11100011111101110111101111101110111110111011111011101"
11110111011111011101111101111011101111110001111"
Vnumberdata (25) = "10000001111101111011110111101111011110111100000111110"
11111111101111111110111111111011111111000111111"
Vnumberdata (26) = "11100011111101110111101111101110111110111011111011101"
11110111011111011101001101111011001111110001011"
Vnumberdata (27) = "10000011111101110111110111011111011101111100001111110"
10111111101101111110110111111011101111000110011"
Vnumberdata (28) = "11100000111101111011110111101111011111111110011111111"
11001111111111011110111101111011110111100000111"
Vnumberdata (29) = "10000000111011011011111101111111110111111111011111111"
10111111111011111111101111111110111111110001111"
Vnumberdata (30) = "10001000111101110111110111011111011101111101110111110"
11101111101110111110111011111011101111110001111"
Vnumberdata (31) = "10001000111101110111110111011111011101111110101111111"
01011111110101111111010111111110111111111011111"
Vnumberdata (32) = "10010100111101010111110101011111010101111101010111110"
01001111110101111111010111111101011111110101111"
Vnumberdata (33) = "10001000111101110111111010111111101011111111011111111"
10111111110101111111010111111011101111000100011"
Vnumberdata (34) = "10001000111101110111110111011111101011111110101111111"
10111111111011111111101111111110111111110001111"
Vnumberdata (35) = "11000000111101110111111111011111111011111111101111111"
10111111111011111111011111111101110111100000011"
'Output image file headers
Response. binarywrite chrb (66) & chrb (77) & chrb (230) & chrb (4) & chrb (0) & chrb (0) & chrb (0) & chrb (0) &_
Chrb (0) & chrb (0) & chrb (54) & chrb (0) & chrb (0) & chrb (0) & chrb (40) & chrb (0) &_
Chrb (0) & chrb (0) & chrb (40) & chrb (0) & chrb (0) & chrb (0) & chrb (10) & chrb (0) &_
Chrb (0) & chrb (0) & chrb (1) & chrb (0)
'Output Image Information Headers
Response. binarywrite chrb (24) & chrb (0) & chrb (0) & chrb (0) & chrb (0) & chrb (0) & chrb( 176) & chrb (4) &_
Chrb (0) & chrb (0) & chrb (18) & chrb (11) & chrb (0) & chrb (0) & chrb (18) & chrb (11) &_
Chrb (0) & chrb (0) & chrb (0) & chrb (0) & chrb (0) & chrb (0) & chrb (0) & chrb (0) &_
Chrb (0) & chrb (0)
For I = 9 to 0 step-1 'goes through all rows
For II = 0 to 3' goes through all words
For IIi = 1 to 10' goes through all pixels
'Output image data row by row, word by word, and pixel by Pixel
If RND * 99 + 1 <codds then' random generation of miscellaneous
Response. binarywrite vcolordata (0)
Else
Response. binarywrite vcolordata (mid (vnumberdata (vcode (II), I * 10 + III, 1 ))
End if
Next
Next
Next
End sub