<%
函数 BytesToBstr(body,Cset)
暗淡对象流
设置 objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.写入主体
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.关闭
设置 objstream = 无
结束函数
url=request.form("url")
如果修剪(url)<>"" 那么
设置 xml = Server.CreateObject("MSXML2.XMLHTTP.5.0")
xml.open“GET”,url,False
xml.发送
bo = BytesToBstr(xml.ResponseBody,"UTF-8")
标头 = xml.GetAllResponseHeaders
设置 xml = 无
结束如果
%>
<html>
<标题>
<title>XMLHTTP测试</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
/ head>
<body bgcolor =“#D4D0C8”topmargin =“20”leftmargin =“0”rightmargin =“0”bottommargin =“0”marginwidth =“0”marginheight =“0”>
<divalign =“center” >
<table border="1" width="770px" cellspacing="0" cellpadding="0" bordercolorlight="#808080" bordercolordark="#FFFFFF" height="356">
<tr>
<表单方法=“帖子”>
<td对齐=“中心”高度=“50”>
<input type="text" name="url" style="width:700;height:20" value="<%=url%>">
<input type="submit" value="查看"> </td>
</形式>
</tr>
<tr>
<td对齐=“中心”高度=“124”>
<textarea id="Textarea2" name="Textarea2" rows="7" cols="105"><%=header%></textarea></td>
</tr>
<tr>
<td高度=“230”对齐=“中心”>
<textarea id="Textarea1" name="Textarea1" rows="14" cols="105"><%=bo%></textarea></td>
</tr>
</表>
</div>
</body>
</html>