如何在 C# 中监控文件访问

发布于 2024-12-10 07:25:28 字数 73 浏览 2 评论 0原文

我想检测特殊目录的文件系统中的更改,我听说可以监视文件访问。谁能告诉我如何在 C#.NET 中监视目录?

谢谢 雷内

i want to detect changes in filesystem for a special directory and i heard that is possible to monitor the file-access. Can anyone tell me how to monitor a directory for example in C#.NET?

THX
Rene

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

厌倦 2024-12-17 07:25:28

您需要FileSystemWatcher

MSDN 上的完整文档位于:http://msdn.microsoft。 com/en-us/library/system.io.filesystemwatcher.aspx

You need the FileSystemWatcher.

Full documentation on MSDN is here: http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx

我不咬妳我踢妳 2024-12-17 07:25:28

有一个 FileSystemWatcher

据我所知,这不适用于 Novell Network 共享(至少我上次尝试时是这样,几年前)。

There is a FileSystemWatcher class.

As far as I know this does not work on Novell Network shares (at least the last time I tried it, some years ago).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文