<%
「訪問者の住所を取得する
ip=リクエスト.サーバー変数(REMOTE_ADDR)
「許可される IP アドレス範囲は 10.0.0.0 ~ 10.68.63.255 です。」
allowip1=10.0.0.0
allowedip2=10.68.10.71
応答.writecheckip(ip,allowip1,allowip2)
functioncheckip(ip,allowip1,allowip2)
ディムチェック(4)
checkip=false
ipstr=split(ip,.)
allow1=split(allowip1,.)
allow2=split(allowip2,.)
ifcint(allow1(0))>cint(allow2(0))then'' は IP アドレス セグメントが正当かどうかを判断します
response.write禁止されたアクセス
終了関数
エンドイフ
fori=0toubound(ipstr)
ifcint(allow1(i))<cint(allow2(i))then
ifcint(allow1(i))=cint(ipstr(i))then
チェック(i)=true
checkip=true
出口用
それ以外
ifcint(ipstr(i))<cint(allow2(i))then
チェック(i)=true
checkip=true
出口用
それ以外
ifcint(ipstr(i))>cint(allow2(i))then
チェック(i)=false
checkip=false
出口用
それ以外
チェック(i)=true
checkip=true
エンドイフ
エンドイフ
エンドイフ
それ以外
ifcint(allow1(i))>cint(ipstr(i))orcint(allow1(i))<cint(ipstr(i))then
チェック(i)=false
checkip=false
ifi<>ubound(ipstr)then
出口用
エンドイフ
それ以外
チェック(i)=true
エンドイフ
エンドイフ
次
if(check(0)=trueandcheck(1)=trueandcheck(2)=trueandcheck(3)=false)and(cint(allow2(2))>cint(ipstr(2)))then
checkip=true
エンドイフ
エンドファンクション
%>
WebShell のブログからの抜粋