/** This code snippet was taken from freecodesnippets.com*/
Imports System.IO
Module Module1
Sub Main()
Dim TextFile As StreamReader
Try
TextFile = New StreamReader("test.txt")
Catch E As Exception
Console.WriteLine("Error opening the file test.txt")
Console.WriteLine("Error {0}", E.Message)
End Try
Dim Content As String
Try
Content = TextFile.ReadToEnd()
Console.WriteLine(Content)
Catch E As Exception
Console.WriteLine("Error reading file")
Console.WriteLine("Error {0}: ", E.Message)
End Try
TextFile.Close()
End Sub
End Module
No replies to this topic
#1
Posted 24 January 2010 - 10:11 PM
Visual Basic Read File Content
|
|
|
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









