title: is there a better way of retrieving my settings?
body: <p>I'm not an IT professional so apologies if I've missed something obvious.</p>
  
  <p>When writing a program I add a class <code>SettingsIni</code> that reads a text file of keys and values. I find this method really flexible as settings can be added or changed without altering any code, regardless of what application I have attached it to.
  Here's the main code.  </p>
  
  <pre><code>Public Shared Sub Load()
  
      Using settingsReader As StreamReader = New StreamReader(System.AppDomain.CurrentDomain.BaseDirectory &amp; "settings.ini")
          Do While settingsReader.Peek &gt; -1
              Dim line As String = settingsReader.ReadLine
              Dim keysAndValues() As String = line.Split("="c)  
              settingsTable.Add(keysAndValues(0).Trim, keysAndValues(1).Trim)
  
              Loop
      End Using
  End Sub
  
  
  Public Shared Function GetValue(ByVal key As String)
      Dim value As String = settingsTable(key)
      Return value
  End Function
  </code></pre>
  
  <p>This allows you to use a setting within your code by calling the <code>SettingsIni.GetValue</code> method.</p>
  
  <p>For example:</p>
  
  <pre><code>watcher = New FileSystemWatcher(SettingsIni.GetValue("inputDir"), "*" &amp; SettingsIni.GetValue("extn")).
  </code></pre>
  
  <p>I find this makes my code esay to read.
  My problem is the values in this case, <code>inputDir</code> and <code>extn</code>, are typed freehand and not checked by intellisense. I'm always worried that I may make a typo in an infrequently used branch of an application and miss it during testing.
  Is there a best practice method for retrieving settings? or a way around these unchecked freehand typed values?</p>