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>


猜你喜欢
- 1.数组和切片有什么区别Go语言中数组是固定长度的,不能动态扩容,在编译期就会确定大小,声明方式如下:var buffer [255]int
- '************************************* 'asp计算随机数&nb
- From Python正则表达式re.match(pattern, string, flags=0)尝试从字符串起始位置匹配一个模式;如果不
- 服务端监听端口 listen()方法:net.listen({监听类型},{监听的ip和端口})(conn, err){}返回值:conn是
- 孤立帐户,就是某个数据库的帐户只有用户名而没有登录名,这样的用户在用户库的sysusers系统表中存在,而在master数据库的syslog
- 对于大的数据库,将数据装载到一个没有 FULLTEXT 索引的表中,然后再使用 ALTER TABLE (或 CRE
- 继上一篇计算checksum校验和,本章通过socket套接字,struct字节打包成二进制,select返回套接字的文件描述符的结合,实现
- SELECT TABLE_SCHEMA,TABLE_NAMEFROM information_schema.`COLUMNS`WHERE C
- Python 的元组与列表类似,不同之处在于元组的元素不能修改。元组使用小括号,列表使用方括号。元组创建很简单,只需要在括号中添加元素,并使
- SQL Server查询速度慢的原因有很,常见的有以下几种:1、没有索引或者没有用到索引(这是查询慢最常见的问题,是程序设计的缺陷)2、I/
- Fiddler,这个是所有软件开发者必备神器!这款工具不仅可以抓取PC上开发web时候的数据包,而且可以抓取移动端(Android,Ipho
- #第一种def delRepeat(liebiao): for x in liebiao: while li
- 通过go语言实现http请求http.Postimport (?? ?"net/http"?? ?"net/u
- 作为一个标准的程序猿,为程序编写说明文档是一步必不可少的工作,如何才能写的又好又快呢,下面我们就来详细探讨下吧。今天将告诉大家一个简单平时只
- 1.安装python windows版本好:python-2.5.1.msi2.安装pycrypto windows版本号:py
- 测试:IE6、IE7、FF3.014突发奇想的效果,主要突出构思,效果还比较粗糙,好好创意一下,应该可以引申出一些比较有新意的图片切换效果。
- 用在产品内容展示的页面上,给产品图片加上提示工具条,鼠标移动图片上即可看到效果,效果还是不错的:带黑白效果和放大图片效果(by misshj
- 任务通过输入的sin曲线与预测出对应的cos曲线#初始加载包 和定义参数import torchfrom torch import nnim
- 本文实例讲述了Python求导数的方法。分享给大家供大家参考。具体实现方法如下:def func(coeff): sum=
- 概述Golang 是一个跨平台的新生编程语言. 今天小白就带大家一起携手走进 Golang 的世界.数据类型转换数据类型转换可以帮助我们将一