大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> 其他相关 -> 利用ASP发送和接收XML数据的处理方法

利用ASP发送和接收XML数据的处理方法

时间: 2021-07-31 作者:daque

由于要做挪动梦网wap的少许接口,以是要用到这种办法,接下来会有asp.net本子的,这个是asp本子的,运用了msxml2.xmlhttp对像。     request.asp  dim https  set https=server.createobject("msxml2.xmlhttp")  ’设置一个xmlhttp对像  https.open "post","http://127.0.0.1/testpost/response.asp",false  https.send " echo  123456 987654  11111 22222 "  if https.readystate=4 then   response.write "提交胜利"   ’readstate读取状况为4则胜利,连接反面的,不可功固然就不必连接处置了   dim objstream   set objstream = server.createobject("adodb.stream")   ’设置一个stream,由于读过来的径直拿出来是乱码的,以是得处置一下   objstream.type = 1   objstream.mode =3   objstream.open   objstream.write https.responsebody   objstream.position = 0   objstream.type = 2   objstream.charset = "gb2312"   html = objstream.readtext   ’转好码,就放到html里,好封闭那些对像   objstream.close   set objstream = nothing   set https=nothing  end if  response.write html  response.asp  ’创造domdocument东西  set xml = server.createobject ("msxml2.domdocument")  xml.async = false  ’承载post数据  xml.load request  if xml.parseerror.errorcode <> 0 then   response.write "不许精确接受数据" & "description: " & xml.parseerror.reason & "<br>line: " & xml.parseerror.line  end if  set blogchild=xml.getelementsbytagname("misc_command")  ’the_text=blogchild.item(0).childnodes(1).text  ’the_text=blogchild.item(0).text  ’for i=0 to blogchild.length-1  response.write the_text    运用这种本领,asp里挪用servlet或web service都是很轻快的!

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.