您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> .NET >> ip限制 将限制IP访问的代码改为允许访问的代码。谢谢

ip限制 将限制IP访问的代码改为允许访问的代码。谢谢

来源:网络整理     时间:2016/7/11 8:45:23     关键词:ip限制

关于网友提出的“ip限制 将限制IP访问的代码改为允许访问的代码。谢谢”问题疑问,本网通过在网上对“ip限制 将限制IP访问的代码改为允许访问的代码。谢谢”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题:ip限制 将限制IP访问的代码改为允许访问的代码。谢谢
描述:

<%
 Dim User_Ip
 User_Ip=Request.servervariables("REMOTE_ADDR")
 call IpLock(User_Ip)
 Sub IpLock(User_Ip)
 Dim IpArray,WhyIpLock
 IpArray=split(User_Ip,".")
 Dim IpSQL,IpRS
 IpSQL="SELECT iplock From IpLock Where  "& _
 " (ipsame=4 and ip1="&Cint(IpArray(0))&" and ip2="&Cint(IpArray(1))&" and ip3="&Cint(IpArray(2))&" and ip4="&Cint(IpArray(3))&" )  "& _
 " Or (ipsame=3 and  ip1="&Cint(IpArray(0))&"  and  ip2="&Cint(IpArray(1))&"  and  ip3="&Cint(IpArray(2))&" )   "& _
 " Or (ipsame=2 and ip1="&Cint(IpArray(0))&" and ip2="&Cint(IpArray(1))&" )   "& _
 " Or (ipsame=1 and ip1="&Cint(IpArray(0))&" ) Order By ipid "
 Set IpRS=Conn.execute(IpSQL)
 If Not (IpRS.bof or IpRS.eof) Then
 WhyIpLock=split(IpRS("iplock"),"|")
  Response.Write"

    你使用的IP段或IP地址已被封锁"
      Response.Write"
  1. 封锁原因:"&WhyIpLock(1)
      Response.Write"
  2. 封锁时间:"&WhyIpLock(0)
      Response.Write"
  3. 请与管理员联系
"
  Response.End
 End If
 Set IpRS=Nothing
 End Sub
%>
以上是限制IP访问的,在一个名为ipcode.asp的文件里
网站里是调用这个ipcode.asp的
现在想改成允许这些IP访问的,请问如何修改,谢谢 


解决方案1:

<%
 Dim User_Ip
 User_Ip=Request.servervariables("REMOTE_ADDR")
 call IpLock(User_Ip)
 Sub IpLock(User_Ip)
 Dim IpArray,WhyIpLock
 IpArray=split(User_Ip,".")
 Dim IpSQL,IpRS
 IpSQL="SELECT iplock From IpLock Where "& _
 " (ipsame=4 and ip1="&Cint(IpArray(0))&" and ip2="&Cint(IpArray(1))&" and ip3="&Cint(IpArray(2))&" and ip4="&Cint(IpArray(3))&" ) "& _
 " Or (ipsame=3 and ip1="&Cint(IpArray(0))&" and ip2="&Cint(IpArray(1))&" and ip3="&Cint(IpArray(2))&" ) "& _
 " Or (ipsame=2 and ip1="&Cint(IpArray(0))&" and ip2="&Cint(IpArray(1))&" ) "& _
 " Or (ipsame=1 and ip1="&Cint(IpArray(0))&" ) Order By ipid "
 Set IpRS=Conn.execute(IpSQL)
 If Not (IpRS.bof or IpRS.eof) Then
  Response.Write"
    你可以正常访问。。。"
      '页面跳转
      Response.End
     End If
     Set IpRS=Nothing
     End Sub
    %>

以上介绍了“ip限制 将限制IP访问的代码改为允许访问的代码。谢谢”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2512912.html

ip限制相关图片

ip限制相关文章