手机
当前位置:查字典教程网 >编程开发 >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中通过oo4o连接Oracle数据库的例子

asp 字符串连接数据库方法

在ASP中连接MySQL数据库,最好的通过ODBC方法

三种禁用FileSystemObject组件的方法

用XML+FSO+JS实现服务器端文件的选择效果

解决ASP(图像)上传漏洞的方法

利用ASP在浏览器上打印输出

asp中COM组件中如何连接数据库的代码

利用ASP连接各种数据库

ASP代码实现301重定向及带参数的方法

精品推荐
分类导航