错误类型:
Microsoft VBScript 编译器错误 (0x800A0400)
缺少语句
/try/checkcode.asp, line 4
Option Explicit
<%
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("CheckCode")=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("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
Ados.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
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>图片验证码程序</title>
</head>
<body>
<%
if request.Form("code")<>"" then
if cstr(request.Form("code"))=cstr(Session("CheckCode")) then
response.Redirect("http://www.cybertang.com")
else
response.write"<script> alert('验证失败,请重新输入验证码');history.back();</script>"
response.enc
end if
end if
%>
<form id ="form1" name="form1" method="post" action="">
<table width="289" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="70">验证码:</td>
<td width="103"><input name="code" type="text" id="code" size="10" maxlength="4"/></td>
<td width="72"><img src="checkcode.asp"></td>
<td width="44"><input type="submit" name="Submit" value="提交"/></td>
</tr>
</table>
</form>
</body>
</html>