Mega Code Archive

 
Categories / VB.Net Tutorial / Stream File
 

Read all text in a text file by using StreamReader

Imports System.IO Module Module1     Sub Main()         Dim SourceFile As StreamReader         Try             SourceFile = New StreamReader("test.txt")             Console.WriteLine(SourceFile.ReadToEnd())             SourceFile.Close()         Catch Except As Exception             Console.WriteLine("Debug file does not yet exist")         End Try     End Sub End Module Java examples (example source code) Organized by topic ...