利用ASP從遠(yuǎn)程服務(wù)器上接收XML數(shù)據(jù)的方法
更新時(shí)間:2007年01月03日 00:00:00 作者:
復(fù)制代碼 代碼如下:
<%
dim objXML
dim objRootElement
dim strValue
dim strInetURL
dim strXML
dim item
strInetURL ="http://pf.inetsolution.com/inetactive2001/inetactive2001news.xml"
Dim HttpReq
set HttpReq = server.CreateObject("MSXML2.XMLHTTP")
HttpReq.open "GET", "http://pf.inetsolution.com/inetactive2001/inetactive2001news.xml", False
HttpReq.send
strXML = HttpReq.responseText
Set objXML = Server.CreateObject("Msxml2.DOMDocument")
objXML.validateonparse = true
objXML.async=false
objXML.loadXML(strXML)
if objXML.ParseError.errorCode <> 0 then
Response.Write("Error: " & objXML.parseError.reason & "<br>")
Response.Write("Code: 0x" & hex(objXML.parseError.errorCode) & "<br>")
Response.Write("At Line: " & objXML.parseError.line & "<br>")
Response.Write("At pos: " & objXML.parseError.linePos & "<br>")
else
set objRootElement = objXML.documentElement
if not isObject(objRootElement) then
Response.Write("no file loaded")
else
Response.Write(objRootElement.childnodes(0).text)
end if
end if
%>
dim objXML
dim objRootElement
dim strValue
dim strInetURL
dim strXML
dim item
strInetURL ="http://pf.inetsolution.com/inetactive2001/inetactive2001news.xml"
Dim HttpReq
set HttpReq = server.CreateObject("MSXML2.XMLHTTP")
HttpReq.open "GET", "http://pf.inetsolution.com/inetactive2001/inetactive2001news.xml", False
HttpReq.send
strXML = HttpReq.responseText
Set objXML = Server.CreateObject("Msxml2.DOMDocument")
objXML.validateonparse = true
objXML.async=false
objXML.loadXML(strXML)
if objXML.ParseError.errorCode <> 0 then
Response.Write("Error: " & objXML.parseError.reason & "<br>")
Response.Write("Code: 0x" & hex(objXML.parseError.errorCode) & "<br>")
Response.Write("At Line: " & objXML.parseError.line & "<br>")
Response.Write("At pos: " & objXML.parseError.linePos & "<br>")
else
set objRootElement = objXML.documentElement
if not isObject(objRootElement) then
Response.Write("no file loaded")
else
Response.Write(objRootElement.childnodes(0).text)
end if
end if
%>
您可能感興趣的文章:
- ColdFusion MX 遠(yuǎn)程服務(wù)實(shí)例入門(mén)教程
- 可以從一臺(tái)遠(yuǎn)程服務(wù)器運(yùn)行 SP2 安裝程序Install.vbs
- C# FTP,GetResponse(),遠(yuǎn)程服務(wù)器返回錯(cuò)誤
- 將MSSQL Server 導(dǎo)入/導(dǎo)出到遠(yuǎn)程服務(wù)器教程的圖文方法分享
- python 從遠(yuǎn)程服務(wù)器下載東西的代碼
- python 從遠(yuǎn)程服務(wù)器下載日志文件的程序
- java判斷遠(yuǎn)程服務(wù)器上的文件是否存在的方法
- 利用xcopy命令實(shí)現(xiàn)本地文件復(fù)制到遠(yuǎn)程服務(wù)器的方法
- Android遠(yuǎn)程服務(wù)編寫(xiě)和調(diào)用教程
相關(guān)文章
asp中文件與文件夾常用處理函數(shù)(文件后綴、創(chuàng)建文件等)
asp中尤其是需要生產(chǎn)靜態(tài)的cms系統(tǒng)中,經(jīng)常需要對(duì)一些文件進(jìn)行判斷與創(chuàng)建,刪除的操作,這里整理了一些,基本上滿(mǎn)足了基本需要。2011-01-01用asp實(shí)現(xiàn)網(wǎng)址和郵件地址的轉(zhuǎn)換函數(shù)
用asp實(shí)現(xiàn)網(wǎng)址和郵件地址的轉(zhuǎn)換函數(shù)...2007-11-11ASP中實(shí)現(xiàn)分頁(yè)顯示的七種方法
這篇文章主要介紹了ASP中實(shí)現(xiàn)分頁(yè)顯示的七種方法,這七種方法可以分為四大類(lèi),需要的朋友可以參考下2015-09-09asp利用Split函數(shù)進(jìn)行多關(guān)鍵字檢索
怎樣提取數(shù)據(jù)庫(kù)用|隔開(kāi)的字!2009-09-09ASP+MSSQL2000 數(shù)據(jù)庫(kù)被批量注入后的解決方法
這陣子,采用ASP+MSSQL設(shè)計(jì)的很多網(wǎng)站可能遭遇到sql數(shù)據(jù)庫(kù)被掛馬者插入JS木馬的經(jīng)歷;這不,朋友的一個(gè)網(wǎng)站就被黑客忽悠了一把2009-02-02ASP中只有UrlEncode,沒(méi)有Urldecode問(wèn)題的解決方法?
這篇文章主要介紹了ASP中只有UrlEncode,沒(méi)有Urldecode問(wèn)題的解決方法? ,需要的朋友可以參考下2015-05-05