Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for a shurtcut of Properties.Settings.Default

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?

like image 844
christophrus Avatar asked Feb 02 '13 13:02

christophrus


People also ask

Where are properties settings default?

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.

Where are application settings 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.

Where are user settings saved C#?

User settings are saved in a file within a subfolder of the user's local hidden application data folder.


1 Answers

Just try it like this:

Properties.Settings settings = Properties.Settings.Default;
settings.var1 = "x";
settings.var2 = "y";
settings.var3 = "Z";
settings.Save();
like image 174
LarsTech Avatar answered Nov 15 '22 10:11

LarsTech