troubleshooting Question

How do I get values from XML file?

Avatar of kirkheaton25
kirkheaton25 asked on
C#
6 Comments1 Solution280 ViewsLast Modified:
I am using the following code to access password protected xml data on a website. I can loop through the xml successfully but I have been unable to get individual values from each node. The xml file has a basic structure of <team><item1>abc<item1><item2>cde</item2>...</team> structure.  (I need to be able to get values for item1 or item2 ).
Thanks
resolver.Credentials = cred;

				Uri baseUri = new Uri (Website);

				Uri fulluri = resolver.ResolveUri (baseUri, "question?id=2");

				Stream s = (Stream)resolver.GetEntity (fulluri, null, typeof(Stream));

			
				XmlReader reader = XmlReader.Create (s);

				while (reader.Read ()) {

			
					Console.WriteLine(reader.Name);

				}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros