日期:2014-05-17  浏览次数:20728 次

App.config的应用
我想自定义一个Section,这个Section下面包含若干个ConfigurationElementCollection,每个ConfigurationElementCollection下面又包含若干个ConfigurationElement,请问如何实现?

我的本意是想实现ConfigurationElementCollection的两极嵌套,我现在有一组数据需要这样处理,但是Section下不允许有多个ConfigurationElementCollection,内层的ConfigurationElementCollection包含多个ConfigurationElement,外层的ConfigurationElementCollection包含多个ConfigurationElementCollection

------解决方案--------------------
过于复杂的配置信息请用xml序列化或Json序列化对象存储到其它文件中。
------解决方案--------------------
直接点来说!只是.net 给你提供了System.Configration这个类让你可以更便捷的操作和使用config文件!
但是如果存在你说的这种情况!建议你还是自己封装。比如说存xml,或者对象序列化保存为文件,这些都很好实现的!