[英]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.