验证码

<%
'Option Explicit
Response.buffer=true
NumCode
Function NumCode()
 Response.Expires = -1
 Response.AddHeader "Pragma","no-cache"
 Response.AddHeader "cache-ctrol","no-cache"
 dim zNum,i,j
 dim Ados,Ados1
 Randomize timer
 zNum = cint(8999*Rnd+1000)
 Session("yzm") = zNum
 if trim(Request.QueryString("dis"))="no" then
     Response.End
 end if
 dim zimg(4),NStr
  NStr=cstr(zNum)
  For i=0 to 3
   zimg(i)=cint(mid(NStr,i+1,1))
  Next
 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("body.Fix"))
  Ados1.write Ados.read(1280)
  for i=0 to 3
   Ados.Position=(9-zimg(i))*320
   Ados1.Position=i*320
   Ados1.write ados.read(320)
  next 
  Ados.LoadFromFile(Server.mappath("head.fix"))
  Pos=lenb(Ados.read())
  Ados.Position=Pos
  for i=0 to 9 step 1
   for j=0 to 3
    Ados1.Position=i*32+j*320
    Ados.Position=Pos+30*j+i*120
    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
End Function
%> 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值