Dispose,using

1.实现IDisposable 接口的类实现Dispose 方法;


2.using(ATest t=new ATest())
{

}
结束时自动调用Dispose();
相当于try{} catch{} ,catch调用Dispose();

原文地址:https://www.cnblogs.com/zhubenxi/p/6651696.html