如何从OS文件系统获取特定文件夹的所有事件 [英] how to Get All events of specific Folder from OS File system
本文介绍了如何从OS文件系统获取特定文件夹的所有事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
如何使用OS文件系统在不使用文件系统的情况下在ex(删除事件)及其子目录的特定文件夹中发生所有事件观察者,
谢谢
Dear All,
How to Get All Event Happened in specific folder for ex(Delete Event) and its sub directory using OS File System with out using file system watcher ,
Thanks
推荐答案
解决方案是编写替代文件系统观察器。您始终可以使用原始Windows API和P / Invoke来执行此操作。
您将需要使用名为的函数*通知
: https://msdn.microsoft.com/en- us / library / aa363950%28v = vs.85%29.aspx 。
参见:
http://en.wikipedia.org/wiki/Platform_Invocation_Services ,
https://msdn.microsoft.com/en-us/library/ms235282.aspx 。
你也可以使用一些替代实现,特别是跨平台,如下所示: http://qt.developpez.com/doc/4.7/QFileSystemWatcher 。
参见:
http://en.wikipedia.org/wiki/Qt_(framework),>
https://qt-project.org/ 。
您不必自己使用P / Invoke,可以使用一些可用的Qt绑定/包装器来实现.NET。请参阅:
https://github.com/ddobrev/QtSharp ,
https://code.google.com/p/qt4dotnet
-SA
The solution would be writing an alternative file system watcher. You can always do it using raw Windows API and P/Invoke.
You will need to use the functions named*Notification
: https://msdn.microsoft.com/en-us/library/aa363950%28v=vs.85%29.aspx.
See also:
http://en.wikipedia.org/wiki/Platform_Invocation_Services,
https://msdn.microsoft.com/en-us/library/ms235282.aspx.
You can also use some alternative implementation, in particular, cross-platform, like this one: http://qt.developpez.com/doc/4.7/QFileSystemWatcher.
See also:
http://en.wikipedia.org/wiki/Qt_(framework),
https://qt-project.org/.
You don't have to use P/Invoke yourself, you can use some available Qt binding/wrapper for .NET. Please see:
https://github.com/ddobrev/QtSharp,
https://code.google.com/p/qt4dotnet
—SA
这篇关于如何从OS文件系统获取特定文件夹的所有事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文