心如止水

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年4月22日

摘要: 1. 规则:允许 Dispose 方法被调用多次而不引发异常。 此方法在首次调用后应该什么也不做。2. using 语句允许程序员指定使用资源的对象应当何时释放资源。为 using 语句提供的对象必须实现 IDisposable 接口,此接口提供了 Dispose 方法,该方法将释放此对象的资源。3. Close和DisposeIn most .NET framework classes, there is no difference between Close() and Dispose(). For example, these methods do the same thing in t 阅读全文
posted @ 2012-04-22 22:57 cutebear 阅读(297) 评论(0) 推荐(0) 编辑