Disposable Using Pattern

前端 未结 5 1310
天涯浪人
天涯浪人 2021-01-04 04:56
  using (FileStream fileStream = new FileStream(path))
  {
    // do something
  }

Now I know the using pattern is an implementation of IDisposable

5条回答
  •  感情败类
    2021-01-04 05:34

    using calls Dispose() only. The Dispose() method might call Close() if that is how it is implemented.

提交回复
热议问题