如何使用COnfigurationManager类读取和写入设置文件?
发布于 2010-07-18 02:14:54
我可以试着在这里给你细分,但实际上下面的链接都是由Jon Rista编写的,是我找到的关于System.Configuration名称空间的最好的资源。
Unravelling the Mysteries of .NET 2.0 Configuration
Decoding the Mysteries of .NET 2.0 Configuration
Cracking the Mysteries of .NET 2.0 Configuration
发布于 2010-07-18 01:50:40
有一件事可能会让您感到困惑:要访问ConfigurationManager类,您必须手动添加对System.Configuration的引用。System.Configuration命名空间被拆分到多个程序集中-默认情况下,您只能获得其中的一部分。
Space Cracker发布了一些很好的链接,但也有一种方法可以编写强类型的配置节,这是我几年前写的博客-- Configuring a .NET 2.0 Application Using the ConfigurationSection class。我从来没有见过其他人使用强类型的ConfigurationSections,但是一旦你习惯了它们,它们就会非常有用。
发布于 2010-07-17 23:21:44
检查以下内容
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx
http://www.codeproject.com/KB/cs/SystemConfiguration.aspx
https://stackoverflow.com/questions/3271946
复制相似问题