H
herceg
Hi all;
How can I read default values for user settings from the app.config
file? I've seen someone mention using
the .DefaultSettingValueAttribute and reflection, but I don't know how
to use them.
I am trying to do the following:
1) Create a simple Windows App that has one user setting named
"SupportAddress" and a default (string) value.
2) The default support address is in the App.Config file.
3) Make a form which allows users to modify and save the setting. This
creates the User.Config file in the Application Data folder.
4) This I don't know - If the users mess up the support address value,
I want to allow them to read the default value for the SupportAddress
setting from the App.Config, not from the User.Config file. Of course,
there will be a button named "Revert to Default" or similar on the
form. What should I do?
Thanks in advance,
Djordje
How can I read default values for user settings from the app.config
file? I've seen someone mention using
the .DefaultSettingValueAttribute and reflection, but I don't know how
to use them.
I am trying to do the following:
1) Create a simple Windows App that has one user setting named
"SupportAddress" and a default (string) value.
2) The default support address is in the App.Config file.
3) Make a form which allows users to modify and save the setting. This
creates the User.Config file in the Application Data folder.
4) This I don't know - If the users mess up the support address value,
I want to allow them to read the default value for the SupportAddress
setting from the App.Config, not from the User.Config file. Of course,
there will be a button named "Revert to Default" or similar on the
form. What should I do?
Thanks in advance,
Djordje