【发布时间】:2010-03-27 06:38:12
【问题描述】:
config.ini:
[globalloads]
plugin.SWPlugin = 1
plugin.SWPlugin.params.1 = true
plugin.SWPlugin.params.2 = 10
[testz : globballoads]
plugin.SWPlugin.params.2 = 20
plugin.SWAnotherPlugin = 1
够简单吗?
// load testz config and programmatically create this equivalent code:
SWPluginAbstract p = new SWPlugin(true, 20);
// go thru the loop and load the other plugin too
SWPluginAbstract p = new SWAnotherPlugin();
如果需要不同的 config.ini 设置来执行此操作,这不是问题...我怀疑我需要使用某种反射类?我是整个 .NET 的新手
【问题讨论】:
标签: c# .net configuration object