Explain how to retrieve property settings from XML .config file.



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

Post New Answer

More XML XSLT RSS Interview Questions

What program opens xsd files?

1 Answers  


How can you change a pdf to a jpeg?

1 Answers  


Can we encode mathematics using XML?

1 Answers  


How do I use the default xml namespace to refer to attribute names in an xml namespace?

1 Answers  


Which browser first used the rss feed?

1 Answers  


What is application xml?

1 Answers  


What are XML Data Islands?

1 Answers   Wipro,


How can a xml file be created from a database?

1 Answers  


What is the difference between DOM & SAX parsers ?

1 Answers  


Explain about xml canonicalization?

1 Answers  


what are the most common errors, while writing xml documents ?

1 Answers  


What is xl file?

1 Answers  


Categories