Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1082347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:17:05+00:00 2026-05-16T22:17:05+00:00

Currently, in my C# .cs file, I have declared a dictionary as such: Dictionary<string,

  • 0

Currently, in my C# .cs file, I have declared a dictionary as such:


Dictionary<string, string> example_map = new Dictionary<string, string>();
option_symbol_map.Add("Key11", "Val1");
option_symbol_map.Add("Key2", "Val2");
option_symbol_map.Add("Key3", "Val3");

I need to move these keys and corresponding values to the app.config file so they can be edited as required.

Whats the best way to implement this?

Should I do it like this:

<add key="Test1" value="Key1,Key2,Key3"/>
<add key="Test2" value="Val1,Val2,Val3"/>

And then read both keys simultaneously while creating my dictionary?

or should I list it this way:

<add key="test3" value="Key1,Val1,Key2,Val2,Key3,Val3"/>

In this case how would I create my map, selecting every alternate object as key and value?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:17:05+00:00Added an answer on May 16, 2026 at 10:17 pm

    Instead of AppSettings you can write your own ConfigurationElementCollection class that reads something like this:

    <yourSection>
       <yourElements>
           <add key="Key1" value="Val1"/>
           <add key="Key2" value="Val2"/>
           <add key="Key3" value="Val3"/>
        </yourElements>      
    </yourSection>
    

    Here is an article that covers the most important parts. If you do this then you do not need to know the keys.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a file abc.htm in my Custom Server Control Project and it's
Currently I just have a file like this that I manually parse into a
I have a properties file which currently contains system names and ip addresses. What
I currently have a .htaccess file set up with this rule: RewriteRule ^([a-zA-Z0-9_-]+)$ user\.php?user=$1
I currently have a class file with the following enumeration: using System; namespace Helper
Currently I have a a text file with data at the first row is
I currently have a csv file that I'm parsing with an example from here:
I currently have a .command file for Mac that contains the following: for f
I currently have a text file that has the following: 1 Commercial & Enterprise
Currently I have an algorithm which somewhat looks like web-spiders or file search systems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.