Imports System
Imports System.IO
Namespace Reader
Class Program
Private Shared Sub Main()
Console.Write("Enter name of file: ")
Dim nameFile As String = Console.ReadLine()
Dim myfile As StreamReader
Try
myfile = File.OpenText(nameFile)
Dim line As String = " "
Do
line = myfile.ReadLine()
If line IsNot Nothing Then
Console.WriteLine(line)
End If
Loop While line IsNot Nothing
Catch e As Exception
Console.WriteLine("Error al intentar abir el fichero.")
End Try
Console.ReadLine()
End Sub
End Class
End Namespace