Monday, March 28, 2011

C# Settings Rembering Settings

How do I get my program to remember the users settings?

From stackoverflow
  • You can either:

    • write the settings to a file
    • Create setting in VS with Project->Properties->Settings... then by using

      Properties.Settings.Default.SettingName = "something"; // Set setting

      this.Text = Properties.Settings.Default.SettingName; // Use setting

    Kildareflare : If you want the settings to persist between application sessions then you will also need to save them: Properties.Settings.Default.Save();
  • Looks like you are looking for UserScopedSettingAttribute

0 comments:

Post a Comment