应为编码需要,要在配置文件中增加如下的内容
需求
这里面用到了常用的节点,节点属性,子元素,子元素集合
自定义节点的编码需要继承ConfigurationSection类
自定义子元素需要继承configurationelement
自定义子元素集合需要继承configurationelementcollection
节点属性的例子在ConfigurationSection类的msdn中有
代码
配置信息自定义
配置信息读取
参考
http://hi.baidu.com/liupras/blog/item/e2ccbf50a1aef7658435240c.html
msndn的代码示例要按下面的顺序阅读和复制执行:
http://msdn.microsoft.com/zh-cn/library/2tw134k3(v=VS.90).aspx
http://msdn.microsoft.com/zh-cn/library/system.configuration.configurationelement(v=VS.90).aspx
http://msdn.microsoft.com/zh-cn/library/system.configuration.configurationelementcollection(v=VS.90).aspx