Module Module1

    Sub Main()
        ' create a file and write to it...
        Dim file As New MyFile("c:\FinalizeDemo.txt")
        file.AddText("Hello, world!")

        ' now, clear the reference to the object...
        file.Dispose()
        file = Nothing

        ' wait for the user to press return...
        Console.WriteLine("Press Return to collect the garbage...")
        Console.ReadLine()

        ' force a collect...
        GC.Collect()

        ' wait for the user to quit...
        Console.WriteLine("Press Return to quit...")
        Console.ReadLine()

    End Sub

End Module
