ASP代码转ASP.net(VB)
假如xml的数据如下<xml><ToUserName><![CDATA[toUser]]></ToUserName><FromUserName><![CDATA[from...
假如 xml 的数据如下
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1348831860</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[this is a test]]></Content>
<MsgId>1234567890123456</MsgId>
</xml>
ASP代码:
<%
set xml_dom = Server.CreateObject("MSXML2.DOMDocument")
xml_dom.load request
strxml=xml_dom.xml
response.Write xml_dom.getelementsbytagname("ToUserName").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("FromUserName").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("CreateTime").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("MsgType").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("Content").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("MsgId").item(0).text & vbcrlf
%> 展开
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1348831860</CreateTime>
<MsgType><![CDATA[text]]></MsgType>
<Content><![CDATA[this is a test]]></Content>
<MsgId>1234567890123456</MsgId>
</xml>
ASP代码:
<%
set xml_dom = Server.CreateObject("MSXML2.DOMDocument")
xml_dom.load request
strxml=xml_dom.xml
response.Write xml_dom.getelementsbytagname("ToUserName").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("FromUserName").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("CreateTime").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("MsgType").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("Content").item(0).text & vbcrlf
response.Write xml_dom.getelementsbytagname("MsgId").item(0).text & vbcrlf
%> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询