Question : VB.Net XML Reading

I Have a xml file like this:
<Profile>
<IPS>
<IP>ipnumber</IP>
<IP>ipnumber</IP>
<IP>ipnumber</IP>
</IPS>
</Profile>

I have code to read a single entry in the <IPS> section like this:
  Dim xmldoc As New XmlDataDocument()
        Dim xmlnode As XmlNodeList
        Dim i As Integer
        Dim fs As New FileStream(xmlf, FileMode.Open, FileAccess.Read)
        xmldoc.Load(fs)
        xmlnode = xmldoc.GetElementsByTagName("IPS")
  For i = 0 To xmlnode.Count - 1
            TextBox1.Text = xmlnode(i).ChildNodes.Item(0).InnerText.Trim()
        Next

My question is, how would I take each <IP> listed in <IPS> and add it to a listbox?

Answer : VB.Net XML Reading

You should be able to use a loop like:
1:
2:
3:
For i = 0 To xmlnode.ChildNodes.Count - 1
   yourList.Add(xmlnode(0).ChildNodes.Item(i).InnerText.Trim())
Next
Random Solutions  
 
programming4us programming4us