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
Default

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:
Code:
Try
    ' 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.
    Do
        line = sr.ReadLine()
        Console.WriteLine(Line)
    Loop Until line Is Nothing
    sr.Close()
Catch E As Exception
    ' Let the user know what went wrong.
    Console.WriteLine("The file could not be read:")
    Console.WriteLine(E.Message)
End Try
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
Reply With Quote