I have a xml file
<config>
<email Host="201.175.0.0" From="[email protected]" Pass="xxx" Name="NameT"/>
<combo/>
<list sex="female"/>
</config>
How can I assign the value of the attributes to variables in vb.net?
I was doing
Dim doc As XmlDocument = New XmlDocument()
doc.Load("Test.xml")
Dim Host = doc.DocumentElement.Attributes.ItemOf("Host").InnerText
Dim From = doc.DocumentElement.Attributes.ItemOf("From").InnerText
Dim Pass = doc.DocumentElement.Attributes.ItemOf("Pass").InnerText
Dim Name = doc.DocumentElement.Attributes.ItemOf("Name").InnerText
Is this correct, what would be a better approach?