get and set values of variables in settings file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michaeldebruin
    New Member
    • Feb 2011
    • 134

    get and set values of variables in settings file

    Is here someone which can give me an example of a code which I can use to set and get values of variables in my settings file?
  • Subin Ninan
    New Member
    • Sep 2010
    • 91

    #2
    • In project properties > Settings
    • create a property with Name as USER and Type as String.


    To set and get this property use below code:

    Code:
    //Store value in USER property from txtUser TextBox
    
    Properties.Settings.Default.USER = txtUser.Text;
    Properties.Settings.Default.Save();
    
    
    //Read USER property in a variable username
    
    string username = Properties.Settings.Default.USER;

    Comment

    • michaeldebruin
      New Member
      • Feb 2011
      • 134

      #3
      Thanks a lot Subin Ninan

      Comment

      Working...