Detect File Read in C#

前端 未结 6 877
眼角桃花
眼角桃花 2020-12-03 22:22

I\'m using FileSystemWatcher to check when a file is modified or deleted, but I\'m wondering if there is any way to check when a file is read by another application.

6条回答
  •  庸人自扰
    2020-12-03 23:15

    There is SysInternals' program FileMon... It can trace every file access in the system. If you can find its source, and understand what win32 hooks it uses, you might marshal those functions in C# and get what you want.

提交回复
热议问题