VB6.0读取XML示例 - 木子屋 和另外 4 个页面 - 用户配置 1
VB6.0读取XML示例编辑:dnawo 日期:2009-09-28字体大小: 小 中 大
复制内容到剪贴板程序代码Option ExplicitPrivate Sub Form_Load()'需引用 Microsoft XML, v6.0Dim xmlDoc As DOMDocumentDim nodeList As IXMLDOMNodeListDim node As IXMLDOMNodeOn Error Resume NextSet xmlDoc = New DOMDocumentxmlDoc.loadXML ("<xml><website><domain>mzwu.com</domain><webmaster>dnawo</webmaster></website><website><domain>abc.com</domain><webmaster>abc</webmaster></website><website><domain>def.com</domain><webmaster>def</webmaster></website></xml>")Set nodeList = xmlDoc.selectNodes("//website")For Each node In nodeListText1.Text = Text1.Text & node.selectSingleNode("domain").Text & vbCrLfNextIf Err.Number <> 0 ThenMsgBox Err.DescriptionEnd IfOn Error GoTo 0End Sub
赞 (0)