本文提供了一套完整的ASP采集功能函数,包含提取地址的原字符,保存远程的文件到本地模拟登录,获取网页源码等功能函数
'=========
=========================================
'函数名:GetHttpPage
'作 用:获取网页源码
'参 数:HttpUrl ------网页地址
'==================================================
Function GetHttpPage(HttpUrl)
If IsNull(HttpUrl)=True Or Len(HttpUrl)<18 Or HttpUrl="$False$" Then
GetHttpPage="$False$"
Exit Function
End If
Dim Http
Set Http=server.createobject("MSX" & "ML2.XM" & "LHT" & "TP")
Http.open "GET",HttpUrl,False
Http.Send()
If Http.Readystate<>4 then
Set Http=Nothing
GetHttpPage="$False$"
Exit function
End if
GetHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
GetHTTPPage=replace(replace(GetHTTPPage , vbCr,""),vbLf,"")
Set Http=Nothing
If Err.number<>0 then
Err.Clear
End If
End Function
.......由于文件较大,点击下载该文件
上一篇:
服务器端用ASP来取得互联网上的任意文件
下一篇:
用Adodb.Stream的SaveToFile方法怎么指定文件的编码为utf-8