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("//allnum").Text Label2.Caption = XMLMorntekDocument.selectSingleNode("//title2").Text Label3.Caption = XMLMorntekDocument.selectSingleNode("//Content2").Text Set XMLMorntekDocument = Nothing Set XMLObject = Nothing End Sub
End Sub 该文章在 2012/7/9 1:28:56 编辑过 |
关键字查询
相关文章
正在查询... |