手机
当前位置:查字典教程网 >编程开发 >ASP教程 >利用ASP从远程服务器上接收XML数据的方法
利用ASP从远程服务器上接收XML数据的方法
摘要:复制代码代码如下:

复制代码 代码如下:<%

dimobjXML

dimobjRootElement

dimstrValue

dimstrInetURL

dimstrXML

dimitem

strInetURL="http://pf.inetsolution.com/inetactive2001/inetactive2001news.xml"

DimHttpReq

setHttpReq=server.CreateObject("MSXML2.XMLHTTP")

HttpReq.open"GET","http://pf.inetsolution.com/inetactive2001/inetactive2001news.xml",False

HttpReq.send

strXML=HttpReq.responseText

SetobjXML=Server.CreateObject("Msxml2.DOMDocument")

objXML.validateonparse=true

objXML.async=false

objXML.loadXML(strXML)

ifobjXML.ParseError.errorCode<>0then

Response.Write("Error:"&objXML.parseError.reason&"<br>")

Response.Write("Code:0x"&hex(objXML.parseError.errorCode)&"<br>")

Response.Write("AtLine:"&objXML.parseError.line&"<br>")

Response.Write("Atpos:"&objXML.parseError.linePos&"<br>")

else

setobjRootElement=objXML.documentElement

ifnotisObject(objRootElement)then

Response.Write("nofileloaded")

else

Response.Write(objRootElement.childnodes(0).text)

endif

endif

%>

【利用ASP从远程服务器上接收XML数据的方法】相关文章:

利用ASP实现事务处理的方法

ASP中生成文本文件的两种方式

asp 字符串连接数据库方法

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

在ASP中使用均速分页法提高分页速度的方法

用ASP实现远程批量文件改名

asp实现批量录入数据的实现

在ASP中通过oo4o连接Oracle数据库的例子

三种禁用FileSystemObject组件的方法

一种理论上最快的Web数据库分页方法

精品推荐
分类导航