App.Config
- Select add new item
- Select Application Configuration File
You should now have an app.config file within your project. The text of this file will look like this:
<configuration> </configuration>
The next step is to add an <appSettings></appSettings> section inside the configuration section. Within this you can then add configuration items in key value pairs. For example if you wanted a configuration option 'Interval' that specified the time in seconds an application should wait before doing something you could add the following:
<add key="Interval" value="10" />
You can then access this configuration option in the code of your application using the following code:
Interval = CInt(System.Configuration.ConfigurationSettings.AppSettings.Get("Interval"))
The complete config file would look like this:
<configuration> <appSettings> <add key="Interval" value="10" /> </appSettings> </configuration>