• 0

VB 2013 saving settings to INI file


Question

Hi Guy's,

 

I have create a settings page for my app and was able to make it save the info i need and load it when the app is starting.

 

The problem i have is that when i'm in side the app and save settings while it's running the settings are not applied. It does save it to the ini file but after the app starts it loads the initial settings and then doesnt read the new settings until the app is restarted.

 

Can you please tell me how i can make sure that the new settings are loaded after i save them?

 

 

Thanks.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Whatever method you call for loading and applying settings at startup, you could call that again after saving new settings. What's stopping you from doing that?

Link to comment
Share on other sites

  • 0

Exactly like above.  You have a loadSettings() function and a saveSettings() function.   Run the loadSettings() function at the end of your saveSettings() function.

Link to comment
Share on other sites

  • 0

do you really want to make an INI file? I mean VB.net has a whole settings system build in already that saves settings to an xml config file using my.settings

Link to comment
Share on other sites

  • 0

do you really want to make an INI file? I mean VB.net has a whole settings system build in already that saves settings to an xml config file using my.settings

You would be amazed at how many people don't know about it.  I mean it's not something I've ever seen advertised.

Link to comment
Share on other sites

  • 0

do you really want to make an INI file? I mean VB.net has a whole settings system build in already that saves settings to an xml config file using my.settings

I didnt actually know that.......

 

I'm new to VB coding so i'm still learning but i will for sure check this option.

 

Thanks for the info.

Link to comment
Share on other sites

  • 0

I didnt actually know that.......

 

I'm new to VB coding so i'm still learning but i will for sure check this option.

 

Thanks for the info.

 

It's not a VB thing it's a .NET thing.  All applications come with an app.config (exename.config) all ASP sites come with a web.config.   You can use built in functions like ConfigurationManager and Properties.Settings.  and such to access and modify settings.

Link to comment
Share on other sites

  • 0

It's not a VB thing it's a .NET thing.  All applications come with an app.config (exename.config) all ASP sites come with a web.config.   You can use built in functions like ConfigurationManager and Properties.Settings.  and such to access and modify settings.

yep, its built into .NET but VB.NET was the first to introduce the my.settings helper if I remember right, it was a few versions ago it first appeared

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.