最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp生成验证码程序
时间:2010-10-08 编辑:简简单单 来源:一聚教程网
numcode (8)
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
if len(trim(request("t")))<1 then
session.timeout=1
else
if isnumeric(trim(request("t"))) then
session.timeout=int(trim(request("t")))
else
session.timeout=1
end if
end if
if len(trim(request("v")))<1 then
session(sessionprefix&"syscode")=listnum
else
session(sessionprefix&trim(request("v")))=listnum
end if
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("www.111com.net/body.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 = "image/bmp"
ados.position = 0
response.binarywrite ados.read()
ados.close: set ados = nothing
ados1.close: set ados1 = nothing
'if err then session(sessionprefix&"checkcode") = "999999"
end function
%>
-
上一个: asp获取文件名与文件大小函数
-
下一个: asp 显示目录所有文件
相关文章
- 加入杂点象素asp验证码生成程序 10-14
- asp 完整高安全验证码生成程序 04-09
- asp 生成验证码程序代码 11-02
- asp生成验证码程序 07-15
- asp验证码生成程序 02-20
- VBS 批量Ping的项目讲解 09-19