Looking for a shurtcut of Properties.Settings.Default

你离开我真会死。 提交于 2019-12-01 05:12:21

Just try it like this:

Properties.Settings settings = Properties.Settings.Default;
settings.var1 = "x";
settings.var2 = "y";
settings.var3 = "Z";
settings.Save();

To shorten a little bit what you have to type you might try adding this to the initial using statements

using MyProps = <your_namespace>.Properties.Settings;

and then in code you could use

MyProps.Default.Var1 = "";

<your_namespace> should be replaced by the full namespace where the settings are defined.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!