public static void Main()
 {
     using (DisposableStreamResource2 dsr2 = new DisposableStreamResource2(@"..\..\file.txt"))
     {
         Console.WriteLine("File Size = " + dsr2.Size);
         // Keep the console window open in debug mode.
         Console.WriteLine("Press any key to exit.");
         Console.ReadKey();
     }
 }
 private DisposableStreamResource2 _resource; // handle to a resource
 public DisposableResourceHolder()
 {
     _resource = new DisposableStreamResource2(@"..\..\file.txt");
 }