Click here to Skip to main content
15,915,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how use configarationmanager
in C#.net
Posted

1 solution

If Settings are User Settings Then
Declare your settings file.

private static Properties.Settings settings;

//then in you main program
C#
public frmMain()
        {
            InitializeComponent();
            settings = new Properties.Settings();
            settings.Reload();
        }

then in you calling method like
string getBaudRate()
{
return settings.BaudRate;
}

and if its app.config File Settings then
ConfigurationSettings.AppSettings["RetryCount"].toString();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900