class - C# what is alternative for settings -
i save settings persist on multiple runs, same thing settings in c# does, when using settings.default.save().
is there alternative store variables in class or similar?
you have lot of options here.
- save settings windows registry.
- save settings text file.
- save settings in database.
here's how go saving application settings:
- create
settingsclass settings properties want save. - create functions
loadsettings(),savesettings(). savesettingsresponsible creating instance of settings, serialize , save it. usenewtonsoft.jsonserialize json.loadsettingsreads file saved data, deserialize it, , populate ui it.
if implement similar, can save settings file custom file extension , associate extension application.
this way, in main method, can check settings file load.
i use approach when have allow more 1 instance of application because <namespace>.properties.settings doesn't cut in case.
Comments
Post a Comment