本代码片段演示了C#中如何实现IDispose接口,实现资源释放
public class MyClass : IDisposable
{
public void Dispose()
{
// release any resources here
// when object is about to be garbage collected
}
public static void Main( )
{
}
}
本代码片段演示了C#中如何实现IDispose接口,实现资源释放
public class MyClass : IDisposable
{
public void Dispose()
{
// release any resources here
// when object is about to be garbage collected
}
public static void Main( )
{
}
}