[英]How to add a new User setting in run time?
我想知道如何在运行时在 CSharp 中添加新的用户设置。 如何动态插入新值? 提前致谢
设置可以代表用户偏好,或应用程序需要使用的有价值的信息。
添加新设置:
Properties.Settings.Default.Properties.Add("property_name",Color.AliceBlue);
Properties.Settings.Default.Save();
编辑现有设置:
Properties.Settings.Default["property_name"]=Color.Green;
Properties.Settings.Default.Save();
检索
Color backColor = Properties.Settings.Default["property_name"] as Color;
删除现有设置:
Properties.Settings.Default.Properties.Remove("property_name");
Properties.Settings.Default.Save();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.