Dim path As String = "c:\MyTest.txt"
Try
If FileSYS.FileExists(path) Then
FileSYS.DeleteFile(path)
End If
Dim sw As IO.StreamWriter = New IO.StreamWriter(path)
sw.WriteLine("This")
sw.WriteLine("is some text")
sw.WriteLine("to test")
sw.WriteLine("Reading")
sw.Close()
Dim sr As IO.StreamReader = New IO.StreamReader(path)
Dim newValue As String
Dim oldValue As String
Do While sr.Peek() > 0
newValue = sr.ReadLine()
oldValue = IIF(newValue <> "" , newValue , oldValue)
Loop
sr.Close()
output.show(oldValue)
Catch e As Exception
output.show("The process failed:" & e.ToString())
End Try