asp屏蔽指定地区禁止访问网站asp
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 %>
上一篇:asp获得当前文件的虚拟物理路径
我要评论