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