最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 生成验证码程序代码
时间:2022-07-02 23:08:16 编辑:袖梨 来源:一聚教程网
<%
Option Explicit
Response.buffer = True
NumCode (8) '注:1,4,7,10,13,16为彩色背景型 2,5,8,11,14,17为黑白型 3,6,9,12,15,18为噪点型
Function NumCode(CodeType)
Response.Expires = -1
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-ctrol", "no-cache"
On Error Resume Next
Dim zNum, rNum, i, j, listnum, listcode
Dim Ados, Ados1
listcode = "0123456789abcdefghijklmnopqrstuvwxyz"
Randomize Timer
Dim zimg(6), NStr
For i = 0 To 5
rNum = CStr(CInt(35 * Rnd)) '将35改为9即为使用纯数字密码
zimg(i) = rNum
listnum = listnum & Mid(listcode, rNum + 1, 1)
Next
Session("CheckCode") = listnum
Dim Pos
Set Ados = Server.CreateObject("Adodb.Stream")
Ados.Mode = 3
Ados.Type = 1
Ados.Open
Set Ados1 = Server.CreateObject("Adodb.Stream")
Ados1.Mode = 3
Ados1.Type = 1
Ados1.Open
Ados.LoadFromFile (Server.mappath("../images/body" & CodeType & ".Fix"))
Ados1.write Ados.read(2880)
For i = 0 To 5
Ados.Position = (35 - zimg(i)) * 480
Ados1.Position = i * 480
Ados1.write Ados.read(480)
Next
Ados.LoadFromFile (Server.mappath("../images/head.fix"))
Pos = LenB(Ados.read())
Ados.Position = Pos
For i = 0 To 15 Step 1
For j = 0 To 5
Ados1.Position = i * 32 + j * 480
Ados.Position = Pos + 30 * j + i * 270
Ados.write Ados1.read(30)
Next
Next
Response.ContentType = "images/BMP"
Ados.Position = 0
Response.BinaryWrite Ados.read()
Ados.Close: Set Ados = Nothing
Ados1.Close: Set Ados1 = Nothing
'If Err Then Session("CheckCode") = "999999"
End Function
%>
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22