国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > 建站經(jīng)驗(yàn) > 正文

asp中對ip、進(jìn)行過濾限制函數(shù)

2019-11-02 15:10:54
字體:
供稿:網(wǎng)友

   看了一些IP限制的函數(shù),覺得太復(fù)雜。所以,試著寫了一個(gè),比較簡單。請網(wǎng)友參考指教。謝謝!~

<%<BR> '獲取訪問者的地址<BR> ip=Request.ServerVariables("REMOTE_ADDR") <BR> <BR> '允許的IP地址段為10.0.0.0~10.68.63.255<BR> allowip1="10.0.0.0"<BR> allowip2="10.68.10.71"<BR> <BR> response.write checkip(ip,allowip1,allowip2)<BR> <BR> <BR> function checkip(ip,allowip1,allowip2)<BR> dim check(4)<BR> checkip=false<BR> ipstr=split(ip,".")<BR> allow1=split(allowip1,".")<BR> allow2=split(allowip2,".")<BR> if cint(allow1(0))>cint(allow2(0)) then '判斷IP地址段是否合法<BR> response.write "IP地址段出錯(cuò)!"<BR> exit function<BR> end if<BR> for i=0 to ubound(ipstr)<BR> if cint(allow1(i))<cint(allow2(i)) then<BR> if cint(allow1(i))=cint(ipstr(i)) then<BR> check(i)=true<BR> checkip=true<BR> exit for<BR> else<BR> if cint(ipstr(i))<cint(allow2(i)) then<BR> check(i)=true<BR> checkip=true<BR> exit for<BR> else<BR> if cint(ipstr(i))>cint(allow2(i)) then<BR> check(i)=false<BR> checkip=false<BR> exit for<BR> else<BR> check(i)=true<BR> checkip=true<BR> end if<BR> end if<BR> end if<BR> else<BR> if cint(allow1(i))>cint(ipstr(i)) or cint(allow1(i))<cint(ipstr(i)) then<BR> check(i)=false<BR> checkip=false<BR> if i<>ubound(ipstr) then<BR> exit for<BR> end if<BR> else<BR> check(i)=true<BR> end if<BR> end if<BR> next<BR> <BR> if (check(0)=true and check(1)=true and check(2)=true and check(3)=false) and (cint(allow2(2))>cint(ipstr(2))) then<BR> checkip=true<BR> end if<BR> <BR&g

歷史人物[www.9-39.com/html/person/]
t; end function<BR> %>

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 临武县| 罗田县| 新余市| 克拉玛依市| 麻江县| 曲麻莱县| 德清县| 临泉县| 平南县| 克什克腾旗| 张家川| 漯河市| 达州市| 中西区| 阜城县| 土默特右旗| 廉江市| 安仁县| 呼玛县| 南昌市| 浦北县| 枣强县| 福泉市| 凌源市| 平顶山市| 苏州市| 三亚市| 会东县| 抚松县| 博兴县| 会昌县| 彩票| 突泉县| 济宁市| 信丰县| 宜兰市| 东兰县| 高要市| 海晏县| 台南市| 高密市|