我需要调用MemoryStream.Close吗? [英] Do I need to call MemoryStream.Close ?

查看:202
本文介绍了我需要调用MemoryStream.Close吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用local方法MemoryStreams。

只读和读写的。


我是否需要调用MemoryStream.Close进行读取只剩下MemoryStreams

离开方法?


那么读写MemoryStreams呢?

-

祝你好运,


Oleg Subachev
su **** **@ural.ru

解决方案




我建议你关闭/处理你的内存流,并将memsrm

变量设置为null ..

在某些情况下,如果你没有将memsrm设置为null,它将锁定此文件并且你

无法重新访问它,直到你重新启动你的电脑..(maby发生了这个消息

只给我)。


问候,

Josip Habjan,克罗地亚

网址: www。 habjansoftware.com


" Oleg Subachev" <醇** @ urvb.ru>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP14.phx.gbl ...

我用方法MemoryStreams本地。
读取和读写的方法。

在离开方法之前,我是否需要为只读MemoryStreams调用MemoryStream.Close?

读写MemoryStreams怎么样?

-
祝你好运,

Oleg Subachev
su ****** @ ural.ru


>我建议你关闭/处理你的内存流,并将memsrm

变量设置为null ..
在某些情况下,如果你没有将memsrm设置为null,它将锁定此文件和
你再也无法访问它,直到你重新启动你的电脑..(maby这种情况仅发生在我身上)。




我的MemoryStreams没有链接任何文件。

-

祝你好运,

Oleg Subachev
su ****** @ ural.ru


你不应该设置变量为null。你需要做的唯一事情就是叫关闭/处置。但是,将变量设置为null总是一个很好的想法,因此你知道不再使用它了。


I use local to methods MemoryStreams.
Both read-only and read-write ones.

Do I need to call MemoryStream.Close for read-only MemoryStreams before
leaving the method ?

And what about read-write MemoryStreams ?
--
Best regards,

Oleg Subachev
su******@ural.ru

解决方案

Hi,

I suggest you to close / dispose your memory stream, and also set memsrm
variable to null..
In some cases if you dont set memsrm to null, it will lock this file and you
could not access it again till you restart your PC.. (maby this happends
only to me).

Regards,
Josip Habjan, Croatia
URL: www.habjansoftware.com

"Oleg Subachev" <ol**@urvb.ru> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...

I use local to methods MemoryStreams.
Both read-only and read-write ones.

Do I need to call MemoryStream.Close for read-only MemoryStreams before
leaving the method ?

And what about read-write MemoryStreams ?
--
Best regards,

Oleg Subachev
su******@ural.ru



> I suggest you to close / dispose your memory stream, and also set memsrm

variable to null..
In some cases if you dont set memsrm to null, it will lock this file and you could not access it again till you restart your PC.. (maby this happends
only to me).



My MemoryStreams are not linked with any files.
--
Best regards,

Oleg Subachev
su******@ural.ru


You should not have to set the variable to null. The only thing you
should need to do is call close/dispose. However, it''s always a good
idea to set the variable to null so you know not to use it anymore.


这篇关于我需要调用MemoryStream.Close吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆