1

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 :)

0

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I am a newb and I don't understand what you mean by 'doc...<id>'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.