VB Code:
Dim xdoc As New XmlDocument xdoc.Load("..\data.xml") For Each nod As XmlNode In xdoc.SelectNodes("//servers/host") TextBox1.Text &=nod.Attributes("ip").Value Next TextBox2.Text=xdoc.SelectSingleNode("//themes/@value").Value TextBox3.Text=xdoc.SelectSingleNode("//locationupdate/@path").Value
But really you should add some error handling just in case no matching node is found.
VB Code:
Dim xdoc As New XmlDocument xdoc.Load("..\data.xml") For Each nod As XmlNode In xdoc.SelectNodes("//servers/host") If Not nod Is Nothing Then TextBox1.Text &=nod.Attributes("ip").Value Next Dim nod As XmlNode node=xdoc.SelectSingleNode("//themes/@value") If Not nod Is Nothing Then TextBox2.Text=nod.Value node=xdoc.SelectSingleNode("//locationupdate/@path") If Not nod Is Nothing Then TextBox3.Text=nod.Value




Reply With Quote