Imports System
Imports System.IO
Public Class Test
Public Shared Sub Main()
Dim fi As FileInfo = New FileInfo("c:\temp\MyTest.txt")
Dim sw As StreamWriter
If fi.Exists = False Then
sw = fi.CreateText()
sw.WriteLine("A")
sw.WriteLine("B")
sw.WriteLine("C")
sw.Flush()
sw.Close()
End If
sw = fi.AppendText()
sw.WriteLine("D")
sw.WriteLine("E")
sw.WriteLine("F")
sw.Flush()
sw.Close()
Dim sr As StreamReader = fi.OpenText()
Dim s As String
Do While sr.Peek() >= 0
s = sr.ReadLine()
Console.WriteLine(s)
Loop
sr.Close()
End Sub
End Class