开发者

ConfigurationManager Class

开发者 https://www.devze.com 2023-01-07 08:56 出处:网络
How do you use the COnfigurationManager class to read and write to the开发者_开发百科 settings file?I could try and give you the breakdown here but really the following links, all written by Jon Rista

How do you use the COnfigurationManager class to read and write to the开发者_开发百科 settings file?


I could try and give you the breakdown here but really the following links, all written by Jon Rista, are the best resources I have found regarding the System.Configuration namespace.

Unravelling the Mysteries of .NET 2.0 Configuration

Decoding the Mysteries of .NET 2.0 Configuration

Cracking the Mysteries of .NET 2.0 Configuration


One thing that might catch you out is that to access the ConfigurationManager class you have to manually add a reference to System.Configuration. The System.Configuration namespace is split across multiple assemblies - you only get part of it by default.

Space Cracker posted some good links, but there is also a way to write strongly typed configuration sections, which I blogged about a few years ago - Configuring a .NET 2.0 Application Using the ConfigurationSection class. I've literally never seen anyone else use strongly typed ConfigurationSections, but once you get used to them they're quite useful.


check the following
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx
http://www.codeproject.com/KB/cs/SystemConfiguration.aspx

0

精彩评论

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

关注公众号