Use Not Disposible object in using statement : IDisposable with using : Class C# Examples


C# Examples » Class » IDisposable with using »

 

Use Not Disposible object in using statement









    
using  System;
public  class  NotDisposible{}

public  class  MainClass
{
    public  static  void  Main(string[]  args)
    {

        //  Uncomment  to  trigger  compile  time  error.
        //  using(NotDisposible  x  =  new  NotDisposible()){}

    }  
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» IDisposable with using