Imports System
Imports System.Data
Imports System.IO
publicclass MainClass
Shared Sub Main()
Dim FileToRead As String = CurDir + "test.txt"
Dim TestFile As FileStream
Try
TestFile = New FileStream(FileToRead, FileMode.Create, FileAccess.ReadWrite)
Dim Writer As New StreamWriter(TestFile)
Writer.WriteLine("8")
Writer.WriteLine("7")
Writer.WriteLine("0")
Writer.WriteLine("ABC")
Writer.WriteLine("5")
Writer.Flush()
TestFile.Seek(0, SeekOrigin.Begin)
Catch CantCreate As Exception
Console.WriteLine("Can't create or write the file")
Exit Sub
End Try
End Sub
End Class