<%
Option Explicit
Response.Buffer = True
Numcode (8) ' Note: 1,4,7,10,13,16 for color background type 2,5,8,11,14,17 for Black-and-white 3,6,9,12,15,18 for noise-point type
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 Rnd)) ' Change 35 to 9 to use a pure digital password
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 1
For j = 0 to 5
Ados1.position = i * + J * 480
Ados.position = Pos + * 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
%>