手机
当前位置:查字典教程网 >编程开发 >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中COM组件中如何连接数据库的代码

asp 字符串连接数据库方法

在ASP程序中打印Excel表格的新方法

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

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

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

利用ASPUPLOAD,ASPJPEG实现图片上传自动生成缩略图及加上水印

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

3种不同的方法生成文件

ASP抽取数据的执行效率

精品推荐
分类导航