%26lt;%
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
url=request.form("url")
if trim(url)%26lt;%26gt;"" 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 = nothing
end if
%%26gt;
%26lt;html%26gt;
%26lt;head%26gt;
%26lt;title%26gt;XMLHTTP测试%26lt;/title%26gt;
%26lt;meta http-equiv="Content-Type" content="text/html;charset=gb2312"%26gt;
%26lt;/head%26gt;
%26lt;body bgcolor="#D4D0C8" topmargin="20" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0"%26gt;
%26lt;div align="center"%26gt;
%26lt;table border="1" width="770px" cellspacing="0" cellpadding="0" bordercolorlight="#808080" bordercolordark="#FFFFFF" height="356"%26gt;
%26lt;tr%26gt;
%26lt;form method="post"%26gt;
%26lt;td align="center" height="50"%26gt;
%26lt;input type="text" name="url" style="width:700;height:20" value="%26lt;%=url%%26gt;"%26gt;
%26lt;input type="submit" value="查看"%26gt; %26lt;/td%26gt;
%26lt;/form%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td align="center" height="124"%26gt;
%26lt;textarea id="Textarea2" name="Textarea2" rows="7" cols="105"%26gt;%26lt;%=header%%26gt;%26lt;/textarea%26gt;%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td height="230" align="center"%26gt;
%26lt;textarea id="Textarea1" name="Textarea1" rows="14" cols="105"%26gt;%26lt;%=bo%%26gt;%26lt;/textarea%26gt;%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;/table%26gt;
%26lt;/div%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;
