开发者

Config file reading

开发者 https://www.devze.com 2023-03-16 06:34 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消