Sunday, October 22, 2006

access application settings in code C#.NET 2005

to access the values predefined in application settings, do this:
label1.Text = Properties.Settings.Default.aaa;
aaa is the name of the variable;

to persist the change, do this:
Properties.Settings.Default.aaa = "bbb";
Properties.Settings.Default.Save();

1 comment:

SF said...

properties.settings.default.save() will make change persistant in application regardless whether it is restarted (F5)