Create object inside the using statement : Using Statement : File Directory Stream C# Examples


C# Examples » File Directory Stream » Using Statement »

 

Create object inside the using statement









    
using  System;  
using  System.IO;  
  
class  MainClass  {  
    public  static  void  Main()  {  
          
        using(StreamReader  sr2  =  new  StreamReader("test.txt"))  {  
            Console.WriteLine(sr2.ReadLine());  
            sr2.Close();  
        }  
  
    }  
}
    
   
  
   



Output

124.23


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» Using Statement