Solved

Group in appSettings

Posted on 2010-09-22
4
1,364 Views
Last Modified: 2012-05-10
Hi,

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?

Thx!

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

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

Open in new window

0
Comment
Question by:Pit76
  • 2
4 Comments
 
LVL 5

Expert Comment

by:roxviper
ID: 33734830
0
 

Author Comment

by:Pit76
ID: 33735037
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.

Thx
0
 
LVL 5

Accepted Solution

by:
roxviper earned 250 total points
ID: 33735187
Hi,

Here is a more detailed tutorial
http://www.codeproject.com/KB/cs/SystemConfiguration.aspx
0
 
LVL 7

Assisted Solution

by:illusio
illusio earned 250 total points
ID: 33735905
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:
http://msdn.microsoft.com/en-us/library/2tw134k3.aspx

There are some tricks you can do with the appSettings but none very advisable.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now