Best way to save per user options in C#

后端 未结 5 457
天涯浪人
天涯浪人 2020-12-06 10:35

What is an easy way to save/load settings? I\'d prefer it if each user has their own set of settings.

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 10:57

    ConfigurationManager works pretty well (desktop application). In essence, you are using the app.config xml file to save settings. For most basic use, just edit the app.config. Add a key value pair for each setting you would like to save... then to access it, just do a ConfigurationManager.get..["yourKey"] and it will return the setting. Setting it is pretty much the same.

提交回复
热议问题