'This code is a Chinese character function added on the basis of others. Thank you very much, and thank you for the Ghost Fire and Wolf Smoke.
'The previous picture verification code was easily cracked, so it is difficult to crack on it based on it to generate Chinese characters.
usage:
Insert code where verification code picture needs to be displayed <imgsrc="code.asp">
At the same time, the session("psn") is automatically generated and the form submission verification session is enough.
The code copy is as follows:
<%
'--------------------
'Chinese character picture verification code
'This code is a Chinese character function added on the basis of others. Thank you very much, and thank you for the Ghost Fire and Wolf Smoke.
'The previous picture verification code was easily cracked, so it is difficult to crack on it based on it to generate Chinese characters.
'Each additional number of interferences ->The cost of exhaustive method increases by about 100*100 times
'As appropriately set the odds of miscellaneous points, it can effectively reduce the correctness of software recognition
'--------------------
OptionExplicit
CallCom_CreatValidCode("SessionName")
Rem generates verification code picture
SubCom_CreatValidCode(pSN)
ConstcodeLen=4'Verification code digit number
ConstcOdds=4'The probability of miscellaneous spots appearing
ConstdbtTimes=1' Number of interferences (safety considerations, it is best not to be less than 2)
ConstcAmount=85' font library quantity
ConstcCode="The sun is so beautiful that there is no moon, and the moon is so beautiful that the mountain is so beautiful that the fire is so big that the west wood is so bright. Ye Jiuqi 65 Combination text is just a fish and sheep. What is the four pieces of life? You are so red and blue. You are so beautiful that you can go to the left and the left and the left and the left and the left and the left and the left and the left and the left and the left and right work are just a square foot. I dreamed that I went to the area. Qu Xun can go to Feng Ai and Liu"' corresponding characters.
ConstUnitWidth=28' word width (to be multiples of 4)
ConstUnitHeight=28' word height
ConstDotsLimit=2'Upper limit for each deleted valid points (avoiding unauthentication)
ConsttryCount=2' Avoid deleting the number of attempts that exceed the upper limit of valid points
'-----------
Randomize
Dimi,ii,iii
'No caching
Response.Expires=-9999
Response.AddHeader"Pragma","no-cache"
Response.AddHeader"cache-ctrol","no-cache"
Response.ContentType="Image/BMP"
'Color data (characters, background)
DimvColorData(1)
vColorData(0)=ChrB(0)&ChrB(0)&ChrB(0)'Blue 0, green 0, red 0 (black)
vColorData(1)=ChrB(211)&ChrB(255)&ChrB(250)'Blue 250, green 236, red 211 (light blue)
'Character data (you can modify it yourself. If you modify the size, remember to change the previous settings as well)
DimvNumberData(85)
vNumberData(0)=""