Create StreamReader through FileStream : StreamReader : File Directory Stream C# Examples


C# Examples » File Directory Stream » StreamReader »

 

Create StreamReader through FileStream









    
using  System;
using  System.IO;

public  class  MainClass
{
    static  void  Main(string[]  args)
    {
        FileStream  MyFileStream  =  new  FileStream(@"c:\Testing.txt",  FileMode.Open,  FileAccess.Read,  FileShare.None);

        StreamReader  MyStreamReader  =  new  StreamReader(MyFileStream);


        for  (int  i  =  0;  i  <  99;  i++)
        {
            int  ch  =  MyStreamReader.Read();
            Console.WriteLine(ch);
            
        }

        MyStreamReader.Close();
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» StreamReader