Go homepage(回首页) Upload pictures (上传图片) Write articles (发文字帖)
The author:(作者)归海一刀published in(发表于) 2014/3/20 5:12:13 XMLHTTP获取web访问头信息和网页代码_[XML教程]
<%
Function BytesToBstr(body,Cset) dim objstream set objstream = Server.CreateObject("adodb.stream") objstream.Type = 1 objstream.Mode =3 objstream.Openobjstream.Write body objstream.Position = 0 objstream.Type = 2 objstream.Charset = Cset BytesToBstr = objstream.ReadText objstream.Close set objstream = nothingEnd Function
url=request.form("url")if trim(url)<>"" then set xml = Server.CreateObject("MSXML2.XMLHTTP.5.0") xml.open "GET",url, False xml.send bo = BytesToBstr(xml.ResponseBody,"UTF-8") header = xml.GetAllResponseHeaders set xml = nothingend if
%>
赞