1.实现IDisposable 接口的类实现Dispose 方法;
2.using(ATest t=new ATest())
{
}
结束时自动调用Dispose();
相当于try{} catch{} ,catch调用Dispose();
1.实现IDisposable 接口的类实现Dispose 方法;
2.using(ATest t=new ATest())
{
}
结束时自动调用Dispose();
相当于try{} catch{} ,catch调用Dispose();
转载于:https://www.cnblogs.com/zhubenxi/p/6651696.html