Using My.Settings to Load Different Configurations

jsurpless

Well-known member
Joined
Jul 29, 2008
Messages
144
Programming Experience
Beginner
Hi all

I currently use a Configuration.xml file to store the various preferences and settings of my application... I'd like to continue using this but allow my different users to "load" individual XML files...

To do this, I imagine I can the My.Settings to identify the location of the appropriate file...

Reading the docs, it seems that I need to use the .Save method after making any changes to my settings but I'm observing that changes are persisting, regardless of not doing this... what am I doing "wrong"?

Many thanks!

-Justin
 
By default, all changes made to My.Settings are saved automatically when the application closes. To change this behaviour you need to untick a box on the Application tab of the project properties. Either way, you can force changes to be saved at any time by calling Save explicitly.
 
by what i can figure out, im currently using something like this.

im using my.settings to load the user prefference. by defult its nothing and loads normal.

if they clicked say "members" it would on next startup load the members section.

:)
 
By default, all changes made to My.Settings are saved automatically when the application closes. To change this behaviour you need to untick a box on the Application tab of the project properties. Either way, you can force changes to be saved at any time by calling Save explicitly.

OK... and from what I gather, you might want to explicitly save at any time because saving can take time and would thus delay closing of the app? I think that's what i read in the help docs?
 
You'd have to have a lot of data to save for it to slow down closing the app significantly. Generally you should just let the settings be saved automatically at shutdown. The only real issue with that is that if your app doesn't shut down properly, like from an application crash or a hard reset, then the new settings won't be saved.
 
Back
Top