刷新文件 [英] Flush files

查看:124
本文介绍了刷新文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




是否可以通过编程方式刷新所有打开的文件?


BR

Peter

Hi,

Is is possible to programmatically flush all opened files ??

BR
Peter

推荐答案

你好彼得,


你是什么意思冲洗所有打开的文件?当使用流打开.NET

框架中的文件时,我们可以调用其Flush方法来清除此流的所有缓冲区

,并将任何缓冲的数据写入

底层设备。你想要冲洗吗?在.NET

应用程序中打开的所有文件?根据我的研究,我们需要冲洗文件一个接一个

因为他们使用不同的Stream。有关.NET框架中的文件和流

I / O的更多信息,您可以参考:

http://msdn2.microsoft.com/en-us/lib...4t(VS.80 ).aspx


如果还有其他问题,请随时告诉我们。


此致,


Luke Zhang


Microsoft在线社区支持

============== ====================================

通过我的帖子收到通知电子邮件?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========


此帖子按原样提供。没有保证,也没有授予任何权利。

Hello Peter,

What did you mean "Flush" all opened files? When opening a file in .NET
framework with stream, we can call its Flush method to clears all buffers
for this stream and causes any buffered data to be written to the
underlying device. Did you want "flush" all files opened in a .NET
application? Based on my research, we need to "flush" the files one by one
since they use different Stream. For more information about File and Stream
I/O in .NET framework, you may refere to:

http://msdn2.microsoft.com/en-us/lib...4t(VS.80).aspx

If there is any further questions, please feel free to let us know.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


你好卢克,


让我重新解释这个问题。 br />

是否可以在本地PC上禁用文件缓存 - 通过更改注册表

键或类似名称?

我已阅读关于控制网络缓存的一些注册表项,但是没有人来控制本地缓存。


我想要这种非chache状态的原因是我想要测试文件

访问速度。


BR

彼得

Hi Luke,

Let me rephrase the question.

Is it possible to disable file cache on a local PC - by changing a registry
key or similar ?
I have read about some registry keys to control network cache, but no one to
control local cache.

The reason for i want this non-chache state is that i want to test file
access speed.

BR
Peter


Hello Peter,

在.NET应用程序中打开文件时,.NET应用程序提供/控制缓存

,不是操作系统(因此没有注册表可以禁用

缓存)。你能解释一下如何在.NET

应用程序中测试访问速度吗?也许我们可以找到避免缓存的影响。


此致,


Luke Zhang


Microsoft在线社区支持

===================================== =============

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========


此帖子按原样提供。没有保证,也没有授予任何权利。

Hello Peter,

When you open a file in .NET application, the cache is provided/controled
by .NET application, not the OS (So there is no a registry to disable
cache). Can you explain more on how you test the access speed in a .NET
application? Maybe we can find to avoid the impact of cache.

Sincerely,

Luke Zhang

Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


这篇关于刷新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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