ASPのIPのフィルタリング制限関数
<%
'訪問者の住所を取得します
ip = request.servervariables( "remote_addr")
'許可されたIPアドレスセグメントは10.0.0.0〜10.68.63.255です
AlowIP1 = "10.0.0.0"
AlowIP2 = "10.68.10.71"
respons.writeCheckip(ip、aotadip1、lowip2)
functionCheckip(IP、lowip1、aothip2)
Dimcheck(4)
checkip = false
ipsstr = split(ip、 "。")
Alow1 = split(loadip1、 "。")
Alow2 = split(approwip2、 "。")
ifcint(approw1(0))> cint(lock2(0))then
「IPアドレスセグメントが合法かどうかを判断してください
Response.Write「IPアドレスセグメントにエラーがあります!」
exitFunction
endif
fori = 0toubund(ipstr)
ifcint(aopt1(i))<cint(lock2(i))then
ifcint(aopt1(i))= cint(ipstr(i))then
(i)= trueをチェックしてください
checkip = true
exitfor
elseifcint(ipstr(i))<cint(lock2(i))then
(i)= trueをチェックしてください
checkip = true
exitfor
elseifcint(ipstr(i))> cint(lock2(i))then
(i)= falseを確認してください
checkip = false
exitfor
それ以外
(i)= trueをチェックしてください
checkip = true
endif
endif
endif
elseifcint(approw1(i))> cint(ipstr(i))orcint(aopt1(i))<cint(ipstr(i))then
(i)= falseを確認してください
checkip = false
ifi <> ubund(ipstr)then
exitfor
endif
それ以外
(i)= trueをチェックしてください
endif
endif
次
if(check(0)= trueandcheck(1)= trueandcheck(2)= trueandcheck(3)= false)および(cint(lock2(2))> cint(ipstr(2)))then
checkip = true
endif
エンド機能
%>
<%
'HTMLフォームを使用して送信されたすべての値を列挙します
foreachiteminrequest.form
respons.writerequest.form(item)
次
%>
HTMLフォームを使用して送信されたすべての値をリストします
ASPを使用して画像サイズを取得します
<%
imgpath = "default_22.gif"
setpp = newimginfo
w = pp.imgw(server.mappath(imgpath))
h = pp.imgh(server.mappath(imgpath))
setpp =何もない
Response.write "<imgsrc = '"&imgpath& "' border = 0> <br> width:"&w& "; high:"&h
classimginfo
ディマソ
privatesubclass_initialize
setaso = createObject( "adodb.stream")
aso.mode = 3
aso.type = 1
aso.open
Endingub
privatesubclass_terminate
err.clear
Setaso =何もない
Endingub
privateFunctionBin2str(bin)
ディミ、str