<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>asp authentication Friend code and Verification code example tutorial </title>
<body>
<input name= "" type= "text"/> Authentication code
</body>
<%
If Request.query ("action") = "ver" Then
Option Explicit
Response.buffer=true
Numcode
Function Numcode ()
Response.Expires =-1
Response.AddHeader "Pragma", "No-cache"
Response.AddHeader "Cache-ctrol", "No-cache"
On Error Resume Next
Dim Znum,i,j
Dim ADOS,ADOS1
Randomize Timer
Znum = CInt (8999*rnd+1000)
Session ("GetCode") = Znum
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 ("Images/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 ("Images/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
If ERR Then session ("GetCode") = 9999
End Function
End If
%>
ASP, graphics Verification Code, verification code, example tutorial