C# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.…
废话不多说,进入正题,先来说说IDisposable,看例子(来自MSDN): using System; using System.ComponentModel; // 下面的例子将展示一个实施了IDisposable接口和Dispose方法的类 public class DisposeExample { public class MyResource: IDisposable { // 指针,指向非托管资源. private IntPtr handle; //类,托管资源. private…