28,391
社区成员
发帖
与我相关
我的任务
分享
<%
private function getIP()
dim strIPAddr
if Request.ServerVariables("HTTP_X_FORWARDED_FOR") = "" or instr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), "unknown") > 0 then
strIPAddr = Request.ServerVariables("REMOTE_ADDR")
elseif instr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") > 0 then
strIPAddr = mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, instr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ",") -1)
elseif instr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") > 0 then
strIPAddr = mid(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), 1, instr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"), ";") -1)
else
strIPAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if
getIP = trim(mid(strIPAddr, 1, 30))
end function
a=split(getIP,".")
if a(0)<>"222" or a(1)<>"45" then
response.Write"禁止访问"
response.End()
end if
'因为后2段都是255了 就不必判读了
'第2个判断
if a(0)<161 and a(0)>166 and a(1)<>"121" and a(2)<>"0" and a(3)<>"1" then
response.Write"禁止访问"
response.End()
end if
%>