摘要: 在2.0中已经不建议使用 IConfigurationSectionHandler 接口来实现自定义配置节,而是改用创建 ConfigurationSection 的派生类来创建自定义配置节。现在我希望的配置文件的结构如下:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlight... 阅读全文
posted @ 2010-01-31 13:34 Aricc 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 1、属性大小写问题 比如有这样一个配置节,其中有三个属性name,ip,port <Server name="server1" ip="192.168.0.11" port="80" /> 那么对应的类要跟这个名字完全匹配,包括大小写。 public class Server : ConfigurationElement{ [ConfigurationProperty("name",... 阅读全文
posted @ 2010-01-31 13:13 Aricc 阅读(235) 评论(0) 推荐(0) 编辑
摘要: I recently had to deal with creating custom sections in the web/app.config file. In the .NET 1.x realm, I had to create a section handler which implements public class CustomSectionHandler: IConfigura... 阅读全文
posted @ 2010-01-31 10:20 Aricc 阅读(248) 评论(0) 推荐(0) 编辑