开发者

IDisposable Example

开发者 https://www.devze.com 2023-03-16 07:56 出处:网络
I am looking for an example in which shows dispose pattern of .net with managed and un-managed resourced are allocated. In every text boo开发者_运维技巧k only code snippets are shown.As of .net 2.0 it

I am looking for an example in which shows dispose pattern of .net with managed and un-managed resourced are allocated. In every text boo开发者_运维技巧k only code snippets are shown.


As of .net 2.0 it's advised to use SafeHandles to manage resources, as detailed on this MSDN page.


MSDN has an example on its IDisposable.Dispose Method page, although as per comments, this is outdated.


I think that all you have to know is very well described in the following article "Digging into IDisposable" on MSDN : http://msdn.microsoft.com/en-us/magazine/cc163392.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号