Explain how to retrieve property settings from XML .config file.
Answer / Sateesh Kumar
To retrieve property settings from an XML .config file in C#, you can use the XmlReader class. Here's a simple example: `using System.Xml; ntXmlReader reader = XmlReader.Create("app.config"); ntwhile (reader.Read()) {nttif (reader.IsStartElement() && reader.Name == "add") {ntttstring key = reader.GetAttribute("key"); ntttstring value = reader.ReadString(); nttt// Do something with the key and value here }nt}n`
| Is This Answer Correct ? | 0 Yes | 0 No |
What program opens xsd files?
How can you change a pdf to a jpeg?
Can we encode mathematics using XML?
How do I use the default xml namespace to refer to attribute names in an xml namespace?
Which browser first used the rss feed?
What is application xml?
What are XML Data Islands?
How can a xml file be created from a database?
What is the difference between DOM & SAX parsers ?
Explain about xml canonicalization?
what are the most common errors, while writing xml documents ?
What is xl file?