The File access classes are in the System.IO namespace, that
needs to be included.
It's really easy, so I only give a C# and basic sample. It just
prints a textfile with line numbers.
// ReadTextFile.cs // (C) Copyright 2003 by Johannes Roith using System; using System.IO; class ReadTextFile { static void Main() { StreamReader file1; int i = 1; file = File.OpenText("readme.txt"); while (file.Peek() != null) { Console.WriteLine(i + " " + file.ReadLine()); i++; } } }
// ReadTextFile.vb // (C) Copyright 2003 by Johannes Roith imports System imports System.IO Public Module ReadTextFile { Public Sub Main () StreamReader file1 int i = 1 file = File.OpenText("readme.txt") While (file.Peek() != null) Console.WriteLine(i + " " + file.ReadLine()) i++ End While End Sub End Module