The more options I have defined, the more a have to type when I have to modify them. So I'm looking for a shorter version of Properties.Settings.Default.varX
I tried:
Properties.Settings settings = Properties.Settings.Default;
settings.var1 = "x";
settings.var2 = "y";
settings.var3 = "Z";
Properties.Settings.Default = settings;
but Properties.Settings.Default is read-only and the Save function has no overload.
So is there any other way than typing Properties.Settings.Default again and again?
There is a folder called "Properties" under your project root folder, and there are *. settings file under that folder. That's where it gets stored.
User-scope settings are stored in the user's appdata folder. Application-scope settings are stored in C:\Users\My Name\AppData\Local\My_Company\. If your settings file doesn't contain any Application-scope settings, you won't have a company folder.
User settings are saved in a file within a subfolder of the user's local hidden application data folder.
Just try it like this:
Properties.Settings settings = Properties.Settings.Default;
settings.var1 = "x";
settings.var2 = "y";
settings.var3 = "Z";
settings.Save();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With