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 8021721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:04:14+00:00 2026-06-04T22:04:14+00:00

I have created a C# console based project . In that project i have

  • 0

I have created a C# console based project. In that project i have some variables like companyName, companyType which are Strings.

companyName="someCompanyName";
companyType="someCompanyType";

I need to create a config file and read values from it, and then initialize the variables companyName, companyType in the code.

  1. How can i create a config file (or equivalent) ?
  2. How can i read from the config file ?
  • 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-06-04T22:04:16+00:00Added an answer on June 4, 2026 at 10:04 pm
    1. Add an Application Configuration File item to your project (Right -Click Project > Add item). This will create a file called app.config in your project.

    2. Edit the file by adding entries like <add key="keyname" value="someValue" /> within the <appSettings> tag.

    3. Add a reference to the System.Configuration dll, and reference the items in the config using code like ConfigurationManager.AppSettings["keyname"].

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

Sidebar

Related Questions

i have created a simple public ref class in the vc++ project, which is
I have a JEE6 project based on Glassfish 3.1.1 that is moving beyond the
I have a long-running console-based application Sender that sends simple text to STDOUT using
I have created a small chatting application in C#, and started as a Console
I have a console application from which I create a window. I can render
I have written a little console application that uses s#arp. I can create an
I have a fairly simple console app that monitors an exchange mailbox, picks particular
I have an ASP.NET forms app that allows users to run some management reports.
What I need is simple: we have a console app project. We want to
I have a project on VS 2005 which was running fine with exchange 2003,

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.