VB.Net by API/System.IO/EndOfStreamException

Материал из VB Эксперт
Перейти к: навигация, поиск

EndOfStreamException.Message

   
Imports System.IO
public class Tester
   public Shared Sub Main
        Dim Stream As IO.StreamReader = IO.File.OpenText("test.txt")
        Try
            Console.WriteLine(Stream.ReadLine())
        Catch e As EndOfStreamException
            Console.WriteLine("EndOfStreamException")
        Catch e As IOException
            Console.WriteLine(e.Message)
        Finally
            Stream.Close()
        End Try
   End Sub
   
End class