iperr.asp
资源名称:qnmov30.rar [点击查看]
上传用户:qyswxdl
上传日期:2013-06-01
资源大小:1373k
文件大小:1k
源码类别:
家庭/个人应用
开发平台:
ASP/ASPX
- <%'用户IP限制
- function LockIP(sip)
- dim str1,str2,str3,str4
- dim num
- LockIP=false
- if isnumeric(left(sip,2)) then
- str1=left(sip,instr(sip,".")-1)
- sip=mid(sip,instr(sip,".")+1)
- str2=left(sip,instr(sip,".")-1)
- sip=mid(sip,instr(sip,".")+1)
- str3=left(sip,instr(sip,".")-1)
- str4=mid(sip,instr(sip,".")+1)
- if isNumeric(str1)=0 or isNumeric(str2)=0 or isNumeric(str3)=0 or isNumeric(str4)=0 then
- else
- num=cint(str1)*256*256*256+cint(str2)*256*256+cint(str3)*256+cint(str4)-1
- sql="select count(*) from LockIP where ip1 <="&num&" and ip2 >="&num&""
- set rs_ip=conn.execute(sql)
- if rs_ip(0)>0 then
- LockIP=true
- end if
- set rs_ip=nothing
- end if
- end if
- end function%>
- <%if LockIP(Request.ServerVariables("REMOTE_ADDR")) then
- response.write "<script>alert('您的IP:"&request.servervariables("remote_addr")&"已经被限制不能访问,请和管理员联系');location.href='about:blank'</script><script>window.close();</script>"
- response.end
- end if
- %>
- <%
- noip=Request.Servervariables("HTTP_X_FORWARDED_FOR")
- If noip="" Then noip=Request.Servervariables("REMOTE_ADDR")
- set rst11=server.createobject("adodb.recordset")
- sql="select * from fuck where userip='"&noip&"'"
- rst11.open sql,conn,1,1
- if not rst11.eof and not rst11.bof then
- response.write "<script>alert('您的IP:"&request.servervariables("remote_addr")&"已经被限制不能访问,请和管理员联系');location.href='about:blank'</script><script>window.close();</script>"
- response.end
- end if
- %>