Group in appSettings


I have some keys in my appSettings. No problem here. Now I want to add some more keys in the appSettings but they should belong to a group so that I can loop through the appsettings but select only that keys that belong to my group.
Example below.

How can I accomplish this and how to retrieve the values?


    <!-- The host for sending emails -->
    <add key="smtpServer" value="mozart"/>
    <add key="smtpUser" value="" />
    <add key="smtpPassword" value="" />

			<add key="Mnemonics1" value="some value"/>
			<add key="Mnemonics2" value="some value"/>
			<add key="Mnemonics3" value="some value"/>
			<add key="Mnemonics4" value="some value"/>

Open in new window

Who is Participating?
roxviperConnect With a Mentor Commented:

Here is a more detailed tutorial
Pit76Author Commented:
I guess you mean the last post in this topic :s
Can you explain that in a simple way? Looks kinda complicated and my exprience is novice level.

illusioConnect With a Mentor Software Architect / Team LeaderCommented:
Normally you don't do it that way.
You create a custom configurationsection - explaining here is a bit long so I did a quick google:

There are some tricks you can do with the appSettings but none very advisable.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.