icrosoft VBScript 运行时错误 错误 '800a0009'
下标越界: '[number: 2]'
/lyb/lyb.asp,行 156
lyb.asp的程序代码如下:
<%
''获取访问者的地址
dim clientip
clientip=Request.ServerVariables("REMOTE_ADDR")
''允许的IP地址段为202.200.200.0~202.200.207.255
allowip1="202.200.200.0"
allowip2="202.200.207.255"
response.write checkip(ip,allowip1,allowip2)
function checkip(clientip,allowip1,allowip2)
dim check(5)
checkip=false
ipstr=split(clientip,".")
allow1=split(allowip1,".")
allow2=split(allowip2,".")
if cint(allow1(0))>cint(allow2(0)) then ''判断IP地址段是否合法
exit function
response.redirect "error.htm"
end if
for i=0 to ubound(ipstr)
if cint(allow1(i))<cint(allow2(i)) then
if cint(allow1(i))=cint(ipstr(i)) then
check(i)=true
checkip=true
exit for
else
if cint(ipstr(i))<cint(allow2(i)) then
check(i)=true
checkip=true
exit for
else
if cint(ipstr(i))>cint(allow2(i)) then
check(i)=false
checkip=false
exit for
else
check(i)=true
checkip=true
end if
end if
end if
else
if cint(allow1(i))>cint(ipstr(i)) or cint(allow1(i))<cint(ipstr(i)) then
check(i)=false
checkip=false
if i<>ubound(ipstr) then
exit for
end if
else
check(i)=true
end if
end if
next
if (check(0)=true and check(1)=true and check(2)=true and check(3)=false) and '行 156 (cint(allow2(2))>cint(ipstr(2))) then '行 156
checkip=true
end if
end function
%>
我是低手,ip限制也是摸索着作,在这里迫切寻求高手的帮助!多谢了