vb Code:
Dim rdrXML As New Xml.XmlTextReader("WebSites.xml") rdrXML.MoveToContent() Dim ElementName As String = "" Dim objListViewItem As ListViewItem = Nothing Do While rdrXML.Read If rdrXML.NodeType = 1 Then ElementName = rdrXML.Name ElseIf rdrXML.NodeType = 3 Then If ElementName = "Name" Then objListViewItem = New ListViewItem(rdrXML.Value) End If If ElementName = "URL" Then objListViewItem.SubItems.Add(rdrXML.Value.ToString) End If If ElementName = "Info" Then objListViewItem.SubItems.Add(rdrXML.Value.ToString) End If ListView1.Items.Add(objListViewItem) End If Loop rdrXML.Close()




Reply With Quote
