Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FileSystemWatcher OnOpened event

In .Net how can I monitor if a file has been accessed (opened) by other programs? I can't see OnOpened 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?

like image 784
Egor Pavlikhin Avatar asked Apr 18 '26 03:04

Egor Pavlikhin


1 Answers

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

like image 122
SRM Avatar answered Apr 20 '26 17:04

SRM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!