最新下载
热门教程
- 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
%>
相关文章
- 世界之外易遇生日活动怎么玩 12-23
- 无期迷途空条徐伦什么时候复刻 12-23
- 无期迷途黛伦蝶之影怎么样 12-23
- 无期迷途空条承太郎什么时候up 12-23
- 无期迷途艾梅斯怎么样 12-23
- 阴阳师小袖之手幽篁流影怎么样 12-23