Phil J Fry Phil J Fry - 15 days ago 6
Vb.net Question

Best Practice (reading external data)

I am writing a Visual Basic Windows Form Application and there are going to be numerous settings that I will need to check on initial form load. Example: user settings

I need to quickly determine screen resolution, personal application background color, and other general user settings and also frequently used items that will populate on the initial splash screen.

I was thinking of switching over to an XML file to store and load the configuration settings.
What is best practice for this?

Answer

I wouldn't use an XML file for this because it'll be a pain to manage across multiple users. Use the user settings feature of the language. It'll help you with multiple users and different settings as well because they will be stored in the user's profile.

You can access settings like this:

Properties.Settings.Default["Username"]

Here's an example for a XAML application but it should fit the general idea:

http://blogs.msdn.com/b/patrickdanino/archive/2008/07/23/user-settings-in-wpf.aspx

Update:

See this post for VB specific:

http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/thread/ed1491b4-65ed-4a06-a770-d37d863ec24e/