Create Stream from FileInfo from OpenText method : File Info « File Stream « C# / C Sharp
- C# / C Sharp
- File Stream
- File Info
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);
}
}
Related examples in the same category