我认为最简单的方式是使用钩子来获得通知(并最终停止)过程。 它无法在. NET 中完成 。 所以您必须使用 < code> Dllimport code > 大量的结构, P/ Invoke 的功能很少 。
s 以 NtSetSetFileInformation
(无记录) 函数开始您的工作。 当文件需要删除时, 它会被任何其他文件调用函数( 使用 FileDisposition Information
结构) 。
问题在于如何勾结该函数( 幸运, 它并不容易 ) 。 一个很好的选择可以是使用 < a href=" http://www. microsoftoft.com/ about/ about/ a/ a> 。 一个很好的选择可以是使用 < a href=" http://www. microsoft Detours/ iplicensing/ prographys/ programs/ detours. aspx" rel= “ http://www. microsoft Detours. com/ arts/ artrof=" http://www. codeproject. com/ arts/ artloadows/ rel= " API- Hooking- with- MS- Detours" rel= " nofolpol " > this 文章 < a > 。 问题在于它不是免费的。 。 替代方案( 价格合理, 与. NET 接口) 是 < a host I dontlear knowst.