I use config files to store variables that may change (such as a server path). It means that I can replace the config file with a new value without having to recompile the application.
For example, a config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="dbServer" value="srv-sql-003"/>
</appSettings>
</configuration>
If the database ever moves from machine srv-sql-003 to another, all I need to do is change the value in the config file and the app will point to the new server location.
You can retrieve values from the config file using:
Dim s As String = System.Configuration.ConfigurationSettings.AppSettings("dbServer"
The config file is also used for dynamic URL's on web services - if you have a reference to a web service and the URL path is set to dynamic, if the web service moves you only need to change the path in the config file, not recompile the app with a redirected proxy.