首頁| 新聞| 娛樂| 游戲| 科普| 文學| 編程| 系統| 數據庫| 建站| 學院| 產品| 網管| 維修| 辦公| 熱點
看了一些ip限制的函數,覺得太復雜。所以,試著寫了一個,比較簡單。請網友參考指教。謝謝!~
代碼拷貝框<%'獲取訪問者的地址ip=Request.ServerVariables("REMOTE_ADDR") '允許的IP地址段為10.0.0.0~10.68.63.255allowip1="10.0.0.0"allowip2="10.68.10.71"response.write checkip(ip,allowip1,allowip2)function checkip(ip,allowip1,allowip2)dim check(4)checkip=falseipstr=split(ip,".")allow1=split(allowip1,".")allow2=split(allowip2,".")if cint(allow1(0))>cint(allow2(0)) then '判斷IP地址段是否合法response.write "IP地址段出錯!"exit functionend iffor i=0 to ubound(ipstr)if cint(allow1(i))<cint(allow2(i)) thenif cint(allow1(i))=cint(ipstr(i)) thencheck(i)=truecheckip=trueexit forelseif cint(ipstr(i))<cint(allow2(i)) thencheck(i)=truecheckip=trueexit forelseif cint(ipstr(i))>cint(allow2(i)) thencheck(i)=falsecheckip=falseexit forelsecheck(i)=truecheckip=trueend ifend ifend ifelseif cint(allow1(i))>cint(ipstr(i)) or cint(allow1(i))<cint(ipstr(i)) thencheck(i)=falsecheckip=falseif i<>ubound(ipstr) thenexit forend ifelsecheck(i)=trueend ifend ifnextif (check(0)=true and check(1)=true and check(2)=true and check(3)=false) and (cint(allow2(2))>cint(ipstr(2))) thencheckip=trueend ifend function%>
索泰發布一款GTX 1070 Mini迷
AMD新旗艦顯卡輕松干翻NVIDIA
索泰發布一款GTX 1070 Mini迷你版本:小機
芭蕾舞蹈表演,真實美到極致
下午茶時間,悠然自得的休憩
充斥這繁華奢靡氣息的城市迪拜風景圖片
從山間到田野再到大海美麗的自然風景圖片
肉食主義者的最愛美食烤肉圖片
夏日甜心草莓美食圖片
人逢知己千杯少,喝酒搞笑圖集
搞笑試卷,學生惡搞答題
新聞熱點
疑難解答
圖片精選
使用ASP建設私人搜索引擎
華為短消息中心的發展與應用
移動通信計費及客戶服務系統
移動客戶服務中心系統
網友關注