净MemoryStream的接近问题

编程入门 行业动态 更新时间:2024-10-25 18:26:37
本文介绍了净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的接近问题

本文发布于:2023-05-25 10:42:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/226461.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:MemoryStream

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!