[C]通过XMLHTTP获取CGI/PHP等程序的返回值
2006-03-17 18:38
309 查看
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "POST",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
Private Function BytesToBstr(Body,Cset)
Dim Objstream
Set Objstream = Server.CreateObject("Adodb.Stream")
Objstream.Type = 1
Objstream.Mode =3
Objstream.Open
Objstream.Write body
Objstream.Position = 0
Objstream.Type = 2
Objstream.Charset = Cset
BytesToBstr = Objstream.ReadText
Objstream.Close
Set Objstream = Nothing
End Function
Dim Str_Url,Result
Result = getHTTPPage(Str_Url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "POST",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
Private Function BytesToBstr(Body,Cset)
Dim Objstream
Set Objstream = Server.CreateObject("Adodb.Stream")
Objstream.Type = 1
Objstream.Mode =3
Objstream.Open
Objstream.Write body
Objstream.Position = 0
Objstream.Type = 2
Objstream.Charset = Cset
BytesToBstr = Objstream.ReadText
Objstream.Close
Set Objstream = Nothing
End Function
Dim Str_Url,Result
Result = getHTTPPage(Str_Url)
相关文章推荐
- PHP中获取我的城市列表,通过排序,通过A-Z的循环!数列出相同的首字母结果!,放到一个以A-Z为key的数组里面去,再返回我要的结果!
- [置顶] 微信小程序通过getPhoneNumber后台PHP解密获取用户手机号码
- 微信小程序获取openid,api.weixin.qq.com不能设为安全域名,通过php转发
- Delphi通过管道执行外部命令行程序(cmd)并获取返回结果
- 【php】怎样通过php程序返回xml格式的数据
- php下通过IP获取地理位置的代码(小偷程序)
- Delphi通过Get获取来自PHP的返回值
- 通过JAVA从高德地图URL连接获取json数据 解析并存入数据库的程序举例
- PHP通过访客来路获取搜索关键词的方法
- 使用localResizeIMG插件上传图片到七牛云返回链接通过PHP进行保存
- PHP通过内置函数memory_get_usage()获取内存使用情况
- PHP通过CURL模拟登录并获取数据
- as3+php通过post提交,get获取
- php获取网页请求状态程序示例
- 通过PHP current函数获取未知字符键名数组第一个元素的值
- Atitit,通过pid获取进程文件路径 java php c#.net版本大总结
- 通过Z-BlogPHP程序快速在论坛里搭建一个博客页面
- php通过$_SERVER['HTTP_USER_AGENT']获取浏览器相关参数(转)
- C#通过程序获取各种路径