简体   繁体   中英

Dynamic Config with Key/Value Pairs

for one c# application I use app.config to store application configuration variable.

In this application I need to store same key/value that are fixed. Also I need to store same key/value "dynamic": my Configuration class where I read this key, read all key which start with a prefix (ie Mail) and store it into a HashTable. Then with a public Method a retrieve every configuration key. Is possibile create into Configuration class, same properties "dynamic" which a specific name. Practically, create at runtime public name (with custom name) from the app.config file.

如果我理解您有关读取(所有)应用程序密钥并过滤所需密钥的问题,请参见此处的示例我将执行ReadAllSettings()并过滤您所需的代码。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM