Mega Code Archive

 
Categories / C# / File Stream
 

Create Stream from FileInfo from OpenText method

using System; using System.IO; public class LicenseViewer {     public static void Main() {         FileInfo license = new FileInfo("c:\\LICENSE.txt");         StreamReader txtIn = license.OpenText();         String line;         do {             line = txtIn.ReadLine();             Console.WriteLine(line);         } while (line != null);     } }