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);
    }
}

           
         
     


This entry was posted in File Stream. Bookmark the permalink.