I am trying to retrieve some information from a .config file. I need to search for specific tags and get the attributes in those tags. For example in application tag i 开发者_如何学JAVAneed to get the attribute path. I don't need any other information from the .config file. I was just going through XmlTextReader but then realised i need a config file and don't know if it is the right way.
The right way is using a ConfigurationElement descendant. For each section in app.config / web.config you have a specific class to manage that section. If you need to modify the app.config / web.config file, you can use the ConfigurationManager class.
I found Using the File attribute of the appSettings element of a .NET config file
And you must read this great article about using configuration file in .NET
Also found Read config file using XMl reader
精彩评论