开发者

FileSystemWatcher OnOpened event

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜