asp屏蔽指定地区禁止访问网站asp

/ / 2023-08-21   阅读:2569
asp屏蔽指定地区禁止访问网站...
<%
SysSitePingbi="True"  '屏蔽开关
If SysSitePingbi="True" then
url="http://whois.pconline.com.cn/ip.jsp?ip="&request.ServerVariables("REMOTE_ADDR")
If Instr(getHTTPPage(url),"四川")>0 Then
  Response.Write ("网站建设中...")
  Response.End()
End if
End if

Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function

Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function

Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function
%>


我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈