|
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
|
Tags: Code, File Directory, Read all file content, Stream Reader, Stream Reader laquo File Directory laquo VBNet, VB.Net
Posted in Uncategorized |
This entry was posted
on Saturday, July 4th, 2009 at 4:59 am and is filed under Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.