人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

局限內外網訪問的ASP代碼

局限內外網訪問的ASP代碼

更新時間:2022-07-21 文章作者:未知 信息來源:網絡 閱讀次數:

    準備只區別內外網的,我們學校的內網都是192.168.*.*的,這個很容易區別,但是校內用戶一用學校對外的代理,IP又變成服務器在外的代理,于是乎又加進去,現在變成了可以允許某些外網訪問了。因為領導要求就這些,只做到這點,以后還可以還可 以豐富,甚至做成組件。

    有些人可能需要這個東西,放上來共享!

    編程高手來提出寶貴意見~~~

    <%
    ip=Request.ServerVariables("REMOTE_ADDR")  '獲取訪問者的地址

    allowip1="192.168.0.0"    '第一允許IP段特點
    allowip2="192.168.255.255" '暫時無用
    allowip3="61.153.213.14"   '具體允許IP地址    
    allowip4="61.129.69.177"

    dim check(5)
    ipstr=split(ip,".")
    allow1=split(allowip1,".")
    allow2=split(allowip2,".")
    allow3=split(allowip3,".")
    allow4=split(allowip4,".")

    for aa=0 to 1
      for bb=0 to 3
      if cint(allow1(aa))&lt;&gt; cint(ipstr(aa)) then
         if cint(allow3(bb))&lt;&gt; cint(ipstr(bb)) then
        if cint(allow4(bb))&lt;&gt; cint(ipstr(bb)) then
        response.redirect "http://www.nhxx.net/err.php"
        end if
      end if
      end if
      next
    next
    %>

    這個也可以,優點是速度快,但輸入IP麻煩

    <%
    '獲取訪問者的地址
    ip=Request.ServerVariables("REMOTE_ADDR")

    allowip1="192.168.0.0"
    allowip2="192.168.255.255"
 
    function checkip(ip,allowip1,allowip2)
    dim check(4)
    ipstr=split(ip,".")
    allow1=split(allowip1,".")
    allow2=split(allowip2,".")
      if cint(allow1(0))&lt;&gt; cint(ipstr(0))   then'判斷IP地址段是否內網用戶
        if cint(ipstr(0))=61 and cint(ipstr(1))=153 and cint(ipstr(2))=213 and cint(ipstr(3))=14 then '判斷具體地址
        else
     if cint(ipstr(0))=61 and cint(ipstr(1))=129 and cint(ipstr(2))=69 and cint(ipstr(3))=166 then
     else
     response.redirect "http://www.nhxx.net/err.php"
     end if
       end if
      end if
    end function
    %>

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 财经| 金沙县| 仙居县| 上蔡县| 甘德县| 章丘市| 玉环县| 勐海县| 莱芜市| 鹤庆县| 松滋市| 安义县| 四子王旗| 陇南市| 贡山| 芜湖市| 封丘县| 资兴市| 东宁县| 顺平县| 巴马| 萍乡市| 彭泽县| 桂平市| 英山县| 曲靖市| 宁津县| 绥芬河市| 阿克苏市| 珠海市| 齐齐哈尔市| 巴青县| 开鲁县| 南宁市| 临沂市| 长阳| 万安县| 苏尼特左旗| 广安市| 屯留县| 南投县|