当以某种方式调用文件操作(例如打开或关闭)时,我是否可以在操作系统继续请求之前处理它,如果可能的话可以通过以下方式取消它:.NET http://en.wikipedia.org/wiki/.NET_Framework?如果.NET没有这样的能力,我该怎么做呢?
你要求做的事都可以做到。例如,病毒扫描程序一直在这样做。您可以轻松监控文件活动过程监控器 http://technet.microsoft.com/en-us/sysinternals/bb896645。您还可以使用 C# 以编程方式执行此操作文件系统观察者类 http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx。但试图阻止程序打开或试图阻止程序访问文件在 C# 中是无法完成的。您将需要使用 C 或 C++。你需要创建一个文件系统过滤驱动程序 http://msdn.microsoft.com/en-us/windows/hardware/gg462968.aspx。构建它是一件复杂的事情,但它正是您所需要的。引用MSDN:
A file system filter driver intercepts requests targeted at a file system or another file system filter driver. By intercepting the request before it reaches its intended target, the filter driver can extend or replace functionality provided by the original target of the request. Examples of file system filter drivers include anti-virus filters, backup agents, and encryption products.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)