XMLHTTP获取web造访头信息和网页代码

来源:asp之家 时间:2010-04-01 14:37:00 

 

<%
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)<>"" 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
%>
<html>
<head>
<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">
<div align="center">
<table border="1" width="770px" cellspacing="0" cellpadding="0" bordercolorlight="#808080" bordercolordark="#FFFFFF" height="356">
<tr>
<form method="post">
<td align="center" height="50">
<input type="text" name="url" style="width:700;height:20" value="<%=url%>">
<input type="submit" value="查看"> </td>
</form>
</tr>
<tr>
<td align="center" height="124">
<textarea id="Textarea2" name="Textarea2" rows="7" cols="105"><%=header%></textarea></td>
</tr>
<tr>
<td height="230" align="center">
<textarea id="Textarea1" name="Textarea1" rows="14" cols="105"><%=bo%></textarea></td>
</tr>
</table>
</div>
</body>
</html>

标签:xmlhttp,http头
0
投稿

猜你喜欢

  • Python移动测试开发subprocess模块项目实战

    2022-09-06 11:11:19
  • Python的Django框架中TEMPLATES项的设置教程

    2022-09-23 03:16:09
  • 布同 Python中文问题解决方法(总结了多位前人经验,初学者必看)

    2021-01-02 08:46:49
  • Centos 6.5下安装MySQL 5.6教程

    2024-01-16 16:57:04
  • 手把手教你将Flask应用封装成Docker服务的实现

    2023-05-27 06:57:15
  • Golang 错误捕获Panic与Recover的使用

    2024-02-07 20:15:42
  • 编写安全的SQL Server扩展存储过程

    2008-11-25 11:16:00
  • Python turtle库绘制菱形的3种方式小结

    2022-04-10 14:08:19
  • SQLServer 2008助你轻松编写T-SQL存储过程

    2010-12-06 13:38:00
  • sql模式设置引起的问题解决办法

    2024-01-17 03:38:16
  • Python使用sort和class实现的多级排序功能示例

    2021-01-30 23:54:46
  • Python中如何给字典设置默认值

    2023-09-21 00:15:32
  • web项目中golang性能监控解析

    2024-02-18 17:28:23
  • js中的内部属性与delete操作符介绍

    2024-04-10 16:15:12
  • pyinstaller打包后,配置文件无法正常读取的解决

    2022-12-17 18:22:09
  • JavaScript 禁止用户保存图片的实现代码

    2024-04-28 09:48:11
  • AI经典书单 人工智能入门该读哪些书?

    2023-06-24 07:11:00
  • GoFrame框架gcache的缓存控制淘汰策略实践示例

    2023-07-22 06:41:19
  • Python深度学习pytorch神经网络图像卷积运算详解

    2021-08-04 12:19:49
  • 解决python3在anaconda下安装caffe失败的问题

    2023-01-30 03:22:43
  • asp之家 网络编程 m.aspxhome.com