VB遠(yuǎn)程讀取XML分支程序
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
以下保存為xml.xml文檔,入在站點(diǎn)根目錄下 <?xml version="1.0" encoding="gb2312" ?> 以下新建一個(gè)VB工程,在對(duì)象窗體中加入三個(gè)Label,在代碼窗體中加入以下代碼: Private Sub Form_Load() WebURL = "http://127.0.0.1/xml.xml" Label1.Caption = "正在查詢..." Dim SendStr As String, XMLrandom As String, XMLObject, ReadFileText As String Set XMLObject = CreateObject("Microsoft.XMLHTTP") ReadFileText = StrConv(XMLObject.ResponseBody, vbUnicode) Label1.Caption = ReadFileText Set XMLMorntekDocument = CreateObject("Microsoft.XMLDOM") Label1.Caption = XMLMorntekDocument.selectSingleNode("http://allnum").Text Label2.Caption = XMLMorntekDocument.selectSingleNode("http://title2").Text Label3.Caption = XMLMorntekDocument.selectSingleNode("http://Content2").Text Set XMLMorntekDocument = Nothing Set XMLObject = Nothing End Sub
End Sub 該文章在 2012/7/9 1:28:56 編輯過(guò) |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |