FileInfo.OpenText : FileInfo « System.IO « C# / C Sharp by API






FileInfo.OpenText

 
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

1.new FileInfo(String fileName)
2.FileInfo.Attributes
3.FileInfo.Create()
4.FileInfo.CreationTime
5.FileInfo.CopyTo(String fileName)
6.FileInfo.Delete
7.FileInfo.Directory
8.FileInfo.FullName
9.FileInfo.LastAccessTime
10.FileInfo.MoveTo(String path)
11.FileInfo.Open
12.FileInfo.OpenRead
13.FileInfo.OpenWrite()