求救各路高手,asp 有没有类似c#中HttpHelper的类,实现Http访问
asp吧
全部回复
仅看楼主
level 1
zhy7979 楼主
求救各路高手,asp 有没有类似c#中HttpHelper的类,实现Http访问,Post或者Get方式的,然后取这个地址中的参数
2015年12月22日 09点12分 1
level 8
'函数作用:远程获取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分 2
1