level 1
'函数作用:远程获取web页面html码
Function getHTTPPage(url)
On Error Resume Next
dim http
set http=Server.createobject("Microsoft.XMLHTTP")
Http.open "GET",url,false '设置http对象打开方式 GET方式,URL[连接页面地址],同步处理
Http.send() '发送请求
if Http.readystate<>4 then '对象处理状态为 非结束
exit function '退出函数
end if
getHTTPPage=BytesToBstr(Http.responseBody,"utf-8")'接收数据并转换
set http=nothing
If Err.number<>0 then ' 错误代码非0则出错
Response.Write "<p align='center'><font color='red'><b>服务器获取文件内容出错</b></font></p>"
Err.Clear '清除错误
End If
End function
2015年12月22日 09点12分