<%
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 adstr1,adstr2
	Randomize timer
	zNum = cint(8999*Rnd+1000)
	Session("loginnumber") = 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 adstr1=Server.CreateObject("Adodb.Stream")
	adstr1.Mode=3
	adstr1.Type=1
	adstr1.Open
	Set adstr2=Server.CreateObject("Adodb.Stream")
	adstr2.Mode=3
	adstr2.Type=1
	adstr2.Open
	adstr1.LoadFromFile(Server.mappath("/imgs/body.Fix"))
	adstr2.write adstr1.read(1280)
	For i=0 To 3
		adstr1.Position=(9-zimg(i))*320
		adstr2.Position=i*320
		adstr2.write adstr1.read(320)
	Next	
	adstr1.LoadFromFile(Server.mappath("/imgs/head.fix"))
	Pos=lenb(adstr1.read())
	adstr1.Position=Pos
	For i=0 To 9 Step 1
		For j=0 To 3
			adstr2.Position=i*32+j*320
			adstr1.Position=Pos+30*j+i*120
			adstr1.write adstr2.read(30)
		Next
	Next
	Response.ContentType = "image/BMP"
	adstr1.Position=0
	Response.BinaryWrite adstr1.read()
	adstr1.Close:set adstr1=nothing
	adstr2.Close:set adstr2=nothing
End Function
%>