最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 获取页面源代码函数xmlhttp
时间:2009-07-13 编辑:简简单单 来源:一聚教程网
'==============================
'函 数 名:GetHttpPage
'作 用:获取页面源代码函数
'参 数:采集链接HttpUrl
'==============================
Public Function GetHttpPage(HttpUrl)
If IsNull(HttpUrl)=True Then
Response.Write("请输入网址!")
Exit Function
End If
On Error Resume Next
Dim Http
Set Http=Server.CreateObject("MSX"&"ML2.XML"&"HTTP")
Http.Open "GET",HttpUrl,False
Http.Send()
If Err Then
Err.clear
Response.Write(SiteCloseStr)
Response.End()
End If
If Http.Readystate<>4 then
Set Http=Nothing
Response.Write("该网页无法访问!")
Exit function
End if
GetHttpPage=BytesToBSTR(Http.responseBody,"GB2312")
Set Http=Nothing
If Err.number<>0 then
Err.Clear
End If
End Function
-
上一个: 判断字符串中相同字符的个数
-
下一个: asp利用xmlhttp取文件乱码问题
相关文章
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16
- asp中获取日期为星期几的技巧 09-14