C#中:如何检查是否打开的文件已更新 [英] C#: How to check if a open file has been updated

查看:807
本文介绍了C#中:如何检查是否打开的文件已更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道的功能,例如,您打开 C:\test.txt 如果你也有在其他编辑同一个文件,并在编辑那里,当您返回时,应用程序会提示该文件已经改变,你是否要更新它。我如何检查文件是否已被更新?

You know the feature for example, you opened C:\test.txt if you also have the same file in another editor, and you edit it there, when you return, the app will prompt that the file has changed, whether you want to update it. How do I check if the file has been updated?

更新

问一姐的问题使用FileSystemWatcher的看文件更改

推荐答案

您可以使用的FileSystemWatcher ,以从文件系统通知。

You could use a FileSystemWatcher to get notifications from the file system.

这篇关于C#中:如何检查是否打开的文件已更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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