开发者

FileSystemWatcher OnOpened event

开发者 https://www.devze.com 2023-02-17 12:48 出处:网络
In .Net how can I monitor if a file has been accessed (opened) by other programs? I can\'t see OnOpe开发者_如何学运维ned event in FileSystemWatcher, so I assume it can not do that. Is there any other

In .Net how can I monitor if a file has been accessed (opened) by other programs? I can't see OnOpe开发者_如何学运维ned event in FileSystemWatcher, so I assume it can not do that. Is there any other way to do it? It's clearly possible in Windows, is there some sort of hook available from .Net?


Check out the NotifyFilters property. You probably want to look for changes in access date/time.


NotifyFilters enumeration has interesting you value: LastAccess indicating last file or directory access. This has to be set to the NotifyFilter property.

0

精彩评论

暂无评论...
验证码 换一张
取 消