|
如果你的网站程序有封IP功能,就使用其封那个站服务器的IP;<br />如果没有可以网上找封IP代码,放在网页就行;<br />给你一段ASP封IP代码:<br /><br /><% <br />Dim IP,IPString,VisitIP <br />'要禁止的IP地址 <br />IPString="|127.0.0.1|61.240.131.94|61.235.36.124|202.104.236.246|221.130.191.150|221.1.220.86|203.171.230.119|221.130.178.242|60.169.2.198|61.132.144.103|202.103.178.16|210.72.225.19|202.105.31.81|60.169.2.178|220.194.44.99|61.156.240.67|" <br />'获取IP地址 <br />IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") <br />If IP = "" Then <br />IP = Request.ServerVariables("REMOTE_ADDR") <br />End If <br />VisitIP="|"&IP&"|" <br />If instr(1,IPString,VisitIP)>0 Then <br />response.write "你的IP被禁止" <br />response.end <br />End If <br />response.Write("你的IP:"&IP&"可以访问本站") <br />%> |
|