Sure, but you may want to explore other options as well. I just happen to like this way, it doesn't mean there aren't better ways to do it.

Serialization is a big subect, in this case we're persisting an object to a file, then deserializing the file back into an object.

Here's my properties class:
VB Code:
  1. Public Class SleuthNCICServiceProperties
  2.     ' The server's address.
  3.     Public serverAddress As String
  4.  
  5.     ' The server's port.
  6.     Public serverPort As Integer
  7.  
  8.     ' The listening port.
  9.     Public listenPort As Integer
  10.  
  11.     ' Lots of decisions in the server application
  12.     ' are based upon the stateUS. i.e. NM, CO, etc.
  13.     Public stateUS As String
  14.  
  15.     Public sendInitialRegisterString As Boolean
  16.     Public initialRegisterORI As String
  17.  
  18.     Public sendHeartbeat As Boolean
  19.     Public heartbeatInterval As Integer
  20.     Public heartbeatCharacter As Integer
  21. End Class

This is how I dim my object in a different class:
VB Code:
  1. Public Class SleuthNCICService
  2.     Inherits System.ServiceProcess.ServiceBase
  3.  
  4.     ' Configuration properties.
  5.     Public Shared properties As New SleuthNCICServiceProperties
  6. .
  7. .
  8. .

I do this at the start of the application. It's an example of serialization in both directions:

VB Code:
  1. Private Sub ReadProperties()
  2.         Dim fileName As String = Application.StartupPath & "\Sleuth-NCIC-Service-properties.xml"
  3.         Dim mySerializer As XmlSerializer = New XmlSerializer(GetType(SleuthNCICServiceProperties))
  4.  
  5.         'A first time thing only - if the properties file does not
  6.         'exist, create a default one.
  7.         If Not File.Exists(fileName) Then
  8.             properties.serverAddress = "localhost"
  9.             properties.serverPort = 4243
  10.             properties.listenPort = 4242
  11.             properties.stateUS = "NM"
  12.             properties.sendInitialRegisterString = True
  13.             properties.initialRegisterORI = "NM1234567"
  14.             properties.sendHeartbeat = True
  15.             properties.heartbeatInterval = 60000
  16.             properties.heartbeatCharacter = 5
  17.  
  18.             Try
  19.                 Dim myWriter As StreamWriter = New StreamWriter(fileName)
  20.                 mySerializer.Serialize(myWriter, properties)
  21.                 myWriter.Close()
  22.             Catch ex As Exception
  23.                 Logger.Log("E", Encoding.ASCII.GetBytes(ex.ToString))
  24.             End Try
  25.         End If
  26.  
  27.         'Deserialize the xml file into a properties object
  28.         Try
  29.             Dim myFileStream As FileStream = New FileStream(fileName, FileMode.Open)
  30.             properties = CType(mySerializer.Deserialize(myFileStream), SleuthNCICServiceProperties)
  31.             myFileStream.Close()
  32.         Catch ex As Exception
  33.             Logger.Log("E", Encoding.ASCII.GetBytes(ex.ToString))
  34.         End Try
  35.     End Sub ' ReadProperties()

The xml file looks like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<SleuthNCICServiceProperties xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <serverAddress>127.0.0.1</serverAddress>
  <serverPort>4243</serverPort>
  <listenPort>4242</listenPort>
  <stateUS>NM</stateUS>
  <sendInitialRegisterString>true</sendInitialRegisterString>
  <initialRegisterORI>NM0260701</initialRegisterORI>
  <sendHeartbeat>true</sendHeartbeat>
  <heartbeatInterval>60000</heartbeatInterval>
  <heartbeatCharacter>5</heartbeatCharacter>
</SleuthNCICServiceProperties>
Then in your code, you use the class members:

VB Code:
  1. ReadProperties()
  2.         If properties.sendHeartbeat Then
  3.             TimerKeepAlive.Interval = properties.heartbeatInterval
  4.             TimerKeepAlive.Enabled = True
  5.         End If