XMLHTTP的应用,获得远程的文件,获得远程HTML文件源码
来源:互联网 发布:java类库在线手册 编辑:程序博客网 时间:2024/05/03 08:33
获得远程的文件
response.write getHTTPPage("http://www.csdn.net")
function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then exit function
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function
Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
--------------------------------------------------------------------
获得远程HTML文件源码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<div id="demo"> <div style="width: 677; height: 70">
</body>
</html>
<script language=vbscript>
sub b3_onclick
Dim objXMLHTTP, xml
Set xml = CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://192.168.8.15:7001/wap_manage/login.asp", False
' Pull the data from the web page
xml.Send
'demo.innerhtml= xml.responseText
'demo.innertext= xml.responseText
demo.innertext= bytes2BSTR(xml.responsebody)
Set xml = Nothing
end sub
sub d1_select
end sub
Function bytes2BSTR(vIn)
Dim strReturn
Dim I, ThisCharCode, NextCharCode
strReturn = ""
For I = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn, I, 1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn, I + 1, 1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
I = I + 1
End If
Next
bytes2BSTR = strReturn
End Function
</script>
<input type="button" value="获取html源码" name="B3">
- XMLHTTP的应用,获得远程的文件,获得远程HTML文件源码
- XMLHTTP的应用,获得远程的文件,获得远程HTML文件源码
- 大灰狼的ASP工具箱——XMLHTTP的应用,获得远程的文件,获得远程HTML文件源码
- 获得远程连接,并且获得远程的资源
- 获得文件的属性
- 获得文件的管理员权限
- 获得文件的MD5
- 通过ip获得远程主机的MAC
- php获得远程文件大小的函数
- php获得远程文件大小的函数
- XMLHTTP检测远程文件存在与否
- 获得class文件的路径
- FtpGetFile获得相同的文件
- 获得文件名 文件的扩展名
- 获得文件名字的后缀
- 获得文件存在的时间
- 获得上传文件的大小
- 获得文件的thumbnail缩略图
- 瞬间搜索海量数据
- 搜索引擎技术核心揭密
- 用Javascript制作站内搜索器
- 大考结束了!
- 自动获得远程图片
- XMLHTTP的应用,获得远程的文件,获得远程HTML文件源码
- 闹洞房方式
- asp中实现限制重复提交同一表单
- ASP中Split函数的实例
- 1.选择合适的安装媒介安装Gentoo
- 从零开始smartphone开发(转自:天极网)
- 《J2ME程序开发全方位基础讲解汇总 》
- 在控制台获得局域网内的所有IP地址
- 一个很牛的计算pi的c程序(我没看懂)