1NetMedia_Blog

<< ES6中三个点扩展运算符(spread)和...  类别: ASP/.NET css三栏布局大全(7种布局方式)... >>
asp获取远程网站源码并显示
[ 日期: 2019-06-18 1:14:42 PM | 作者: admin | 来源: Original | 人气:141 | 晴天 | 心情: +2 ] 字号: 【
急速栏目链接:
标签:获取页面源码  |  
<%
server.Scripttimeout=999999
TD_server="http://www.baidu.com/"
'host_name="http://"&request.servervariables("HTTP_HOST")&request.servervariables("script_name")
'Remote_file = TD_server&"/index.php"&"?host="&host_name&"&url="&Request.servervariables("Query_String")&"&domain="&Request.servervariables("Server_Name")
'Content_mb=GetHtml(Remote_file)
Content_mb=GetHtml(TD_server)
response.write Content_mb
%>
<%
Function GetHtml(url)
  Set ObjXMLHTTP=Server.createObject("MSXML2.serverXMLHTTP")
  ObjXMLHTTP.Open "GET",url,False
  ObjXMLHTTP.setRequestHeader "User-Agent","aQ0O010O"
  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 = "gb2312"
  GetHtml = objStream.ReadText
  objStream.Close
End Function
%>
   
Rss Comment  

没有相关评论

发表评论
请先注册,才能发表评论!
- 注册 -