LeighWardle
asked on
What is the best way using vb.net to save settings on a per application and per user/application basis?
Hi Experts,
What is the best way using vb.net to save settings on a per application and per user/application basis?
One additional contraint is that I would to initialize some of the settings using my installer program, Setup Factory for Windows.
Thanks,
Regards,
Leigh
What is the best way using vb.net to save settings on a per application and per user/application basis?
One additional contraint is that I would to initialize some of the settings using my installer program, Setup Factory for Windows.
Thanks,
Regards,
Leigh
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, Raghu and kaufmed, for your suggestions.
I will go with XML files.
Just a few questions:
Thanks,
Regards,
Leigh
I will go with XML files.
Just a few questions:
1.
Can you point me to a sample project that shows how to manipulate XML settings in code?2.
Where is the user's profile directory on Windows 7 or later?Thanks,
Regards,
Leigh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, Raghu and kaufmed, for your suggestions.
kaufmed - I really appreciate your detailed advice.
Regards,
Leigh
kaufmed - I really appreciate your detailed advice.
Regards,
Leigh
.NET applications have the Settings file which you can set either user-level or application-level settings. Just go to Project->Properties->Setti
User-scoped settings end up in an XML file that is in the user's profile directory; application settings end up in the application config file (in the same directory as the application). Don't be fooled: While the application config file will show your user-scoped setting, this is more of a default value that will be provided to new users of your app. The actual value that is set for the individual users is stored in each user's profile directory.
You could use the registry as Raghu suggests in his second point, but .NET leans toward XML configuration files versus using the registry. You can still access the registry in .NET, but it's not the preferred place to store configuration.
You could also use a database, but this more of a heavyweight solution. There's nothing wrong with using a database, but just be sure you plan out the database carefully so that if you ever have to make changes they won't cripple your application unnecessarily.