See the examples here
Sub ReadCalibration()
' Determine the path of the file from the application itself
Dim calfile As String = Application.StartupPath + "\cal.txt"
If File.Exists(calfile) Then '
Illegal whitespace in constant
Dim tr As New StreamReader(calfile)
Dim num As String = tr.ReadLine()
Calibration = Convert.ToInt32(num)
tr.Close()
End If
End Sub 'ReadCalibration
Sub WriteCalibration()
Dim calfile As String = Application.StartupPath + "\cal.txt"
Dim tw As New StreamWriter(calfile) '
tw.Flush() ' Write out the calibration value
tw.WriteLine(Calibration.ToString())
tw.Close()
End Sub 'WriteCalibration
http://www.vbdotnetheaven.com/Code/Jun2003/2090.asp
http://www.builderau.com.au/program/windows/print.htm?TYPE=story&AT;=20267367-39024644t-20000994c
http://www.builderau.com.au/program/windows/0,39024644,20267367,00.htm
thanks