Question : How to use my.settings in vb.net

Can some one show me some example code of how to use the My.Settings file in vb.net to check for and store user selected values?

In my case if the user has already made a selection from a drop down list box in a previous session, he/she should not have to make the same selection again in the current session.

I have already tried System.Configuration.ConfigurationManager.AppSettings.Set(), but for some reason that did not update the app.config file at all.

Thanks in advance for your kind assistance.

Answer : How to use my.settings in vb.net

To set a setting I use the following:

  My.Settings.strHomeURL = txtHome.Text

  (where strHomeURL is a type of String and has User scope and strHomeURL is the name of the setting)


To retrieve a setting from the same I use:

  txtHome.Text = My.Settings.strHomeURL

  (txtHome is a textbox)


You may also find the following helpful:

  http://msdn.microsoft.com/en-us/library/cftf714c.aspx
Random Solutions  
 
programming4us programming4us