Solved

Group in appSettings

Posted on 2010-09-22
4
1,410 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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