Reading XML from VB.Net and storing in variable
Hello I am trying to retrieve a 'tag'(Is it called that?) from an XML webpage. Once I make a post request from my vb.net app it sends a command to my online webserver and redirects me to a page that has entries that change each time. The page that im redirected to that changes each time looks something like this:
<mainpage> <id>hello</id> <random>176</random> </mainpage>
What vb.net code would I use to retrieve the id (In this case 'hello') and store it in a variable. I appreciate any help :)
in vb.net (not tested)
dim doc as XDocument = XDocument.Parse(stringContainingXML) dim valueOfIdElement as string = (doc...<id>).first.value
You should look at the documentation for the System.Xml.Linq namespace.