asp如何做到只有特定IP範圍者

 [黃韋翔] 無 無 asp如何做到只有特定IP範圍者..... 2002/3/19 
--------------------------------------------------------------------------------
asp如何做到只有特定IP範圍者才能看到其網頁內容,不是該IP範圍則秀出抱歉!
例如是140.123.1.1~140.123.1.120 
有沒有飯粒可以參考 


[劉錫禎] 無 無 Re: asp如何做到只有特定IP範圍者..... 2002/3/19 
--------------------------------------------------------------------------------

==========================================
’檢查特定範圍IP

ip_address=Request.ServerVariables("REMOTE_ADDR")

ip=split(ip_address, ".")

if (ip(0)="140" and ip(1)="123" and ip(2)="1" and ip(3)>="1" and ip(3)<="120") then
checkip=true
else
checkip=false
response.redirect "error.asp"
end if



--------------------------------------------------------------------------------
[黃韋翔] 無 無 Re: asp如何做到只有特定IP範圍者..... 2002/3/19 
--------------------------------------------------------------------------------
若有另一個虛擬的學校網段(172.20.1.1~172.20.1.254)要如何設定?
偶試過以下的,不行
if (ip(0)="140" and ip(1)="123" and ip(2)="1" and ip(3)>="1" and ip(3)<="120") 
OR (ip(0)="172" and ip(1)="20" and ip(2)="1" and ip(3)>="1" and ip(3)<="254") th
en

謝謝^_^ 

--------------------------------------------------------------------------------
[黃韋翔 ]無 無 Re: asp如何做到只有特定IP範圍者..... 2002/3/19 
--------------------------------------------------------------------------------
謝謝您!剛試了一下,可以了^_^
checkip=true
但如何是校內的IP,如何讓他連到另一個網頁,例如是123.htm 

--------------------------------------------------------------------------------

[黃韋翔] 無 無 Re: asp如何做到只有特定IP範圍者..... 2002/3/19 
--------------------------------------------------------------------------------
偶知道了
checkip=true
response.redirect "123.htm" 

--------------------------------------------------------------------------------