View Single Post
  #2 (permalink)  
Old January 10th, 2006, 12:59 PM
Jeff Mason Jeff Mason is offline
Friend of Wrox
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post

Look up the streamreader class (there are other ways to do what you want, but this is, I think, the simplest). Here is some example code from the help:
    ' Create an instance of StreamReader to read from a file.
    Dim sr As StreamReader = New StreamReader("TestFile.txt")
    Dim line As String
    ' Read and display the lines from the file until the end 
    ' of the file is reached.
        line = sr.ReadLine()
    Loop Until line Is Nothing
Catch E As Exception
    ' Let the user know what went wrong.
    Console.WriteLine("The file could not be read:")
End Try
Jeff Mason
Custom Apps, Inc.
Reply With Quote