flymorn改进一下以上的新意,直接把3+6=多少的形式采用asp程序生成Bmp图片格式,并且把数字相加后的和存进session里,加大破解的门槛;没有一些图形图像学知识的人是无法破解的。代码如下:
复制代码 代码如下:
<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.cachecontrol = "no-cache"
Response.ContentType = "Image/Bmp"
Call Com_CreatValidCode()
Sub Com_CreatValidCode()
Randomize
Dim i, ii, iii
Const cAmount = 10 '数值个数
Const cCode = "0123456789" '数值范围
Dim vColorData(2)
vColorData(0) = "" '黑色点要转为彩色点,暂时不定义
vColorData(1) = ChrB(255) & ChrB(255) & ChrB(255) '白点
Dim vCode(4), vCodes '产生一组任意数
For i = 0 To 3
vCode(i) = Int(Rnd * cAmount) '数组等于总数*随机数
if i=1 then vCode(i)="11" '第二位为+
if i=3 then vCode(i)="10" '第四位为=
vCodes=vCodes&Mid(cCode,vCode(i)+1,1) '串等于串加上后续值
Next
session("checkcode")=int(Mid(vCodes,1,1)) + int(Mid(vCodes,2,1)) '计算相加和值并赋值给session
Dim vNumberData(36)
vNumberData(0) =
"1110000111110111101111011110111101111011110111101111011110111101111011110111101111011110111110000111"
vNumberData(1) =
"1111011111110001111111110111111111011111111101111111110111111111011111111101111111110111111100000111"
vNumberData(2) =
"1110000111110111101111011110111111111011111111011111111011111111011111111011111111011110111100000011"
vNumberData(3) =
"1110000111110111101111011110111111110111111100111111111101111111111011110111101111011110111110000111"
vNumberData(4) =
"1111101111111110111111110011111110101111110110111111011011111100000011111110111111111011111111000011"
内容版权声明:除非注明,否则皆为本站原创文章。