本文介绍了净MemoryStream的接近问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于一个净的MemoryStream对象实例,我需要使用它后,明确地关闭它?或者没有必要关闭它?这是最好的做法是什么?
For a .Net MemoryStream object instance, do I need to close it explicitly after using it? Or no need to close it? Which is the best practices?
我使用VSTS2008 +净3.5 + C#。
I am using VSTS2008 + .Net 3.5 + C#.
在此先感谢, 乔治
推荐答案您应该关闭它,当你用它做。最好的做法是在一个try-catch-finally块的最后部分关闭流。你可以在这里得到更多的信息:
you should close it when you are done with it. The best practice is to close the stream in the finally section of a try-catch-finally block. you can get more information here:
msdn.microsoft/en-美国/库/ system.io.memorystream.aspx
更多推荐
净MemoryStream的接近问题
发布评论