0

I need your help on this. I've seen a lot of articles on how to create a custom web.config reader (like this: Custom ConfigurationSections in .NET 2.0 .config Files). However, is it possible to have something general where I can just pass the configuration section and keys? Moreover, how is this done?

Sample web.config 1:

<Section1>
   <add Key1="value1-A" Key2="value1-B" Key3="value1-C"/>
   <add Key1="value2-A" Key2="value2-B" Key3="value2-C"/>
</Section1>

Sample web.config 2:

<Section2>
   <add Key1="value1-A" Key2="value1-B" Key3="value1-C"/>
   <add Key1="value2-A" Key2="value2-B" Key3="value2-C"/>
</Section2>
Musikero31
  • 3,115
  • 6
  • 39
  • 60
  • with multiple keys in a line? or key-value pair like – Eugene May 07 '13 at 05:23
  • with multiple keys. but it has to be generic so that it can be used anywhere. i think it's a bit weird if we just specify it to a certain config section right? – Musikero31 May 07 '13 at 05:39
  • Can you describe a usage? – Eugene May 07 '13 at 06:59
  • there are some config files that have this kind of scenario. so what i want is a certain class in which i can pass any config section and get the values of the keys (i.e., key1, key 2, key3). – Musikero31 May 07 '13 at 07:17

0 Answers0