VB遠程讀取XML分支程序
當前位置:點晴教程→知識管理交流
→『 技術文檔交流 』
以下保存為xml.xml文檔,入在站點根目錄下 <?xml version="1.0" encoding="gb2312" ?> 以下新建一個VB工程,在對象窗體中加入三個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 編輯過 |
關鍵字查詢
相關文章
正在查詢... |