As "opening" a file might occur for various reasons, you have several means depending on the operation: let's say
read or
write. And let's suppose you want to watch an NTFS file system.
You can take a look at the following:
- USN (write):
Eyes on NTFS[
^],
http://www.donationcoder.com/forum/index.php?topic=22695[
^]
- Audit trail (read/write) (
http://support.microsoft.com/kb/310399[
^]), and reading the logs
-
FileSystemWatcher[
^] (write)
-
EyeHook[
^] (read/write)
- and of course, you can use
FileInfo.LastAccessTime[
^] (or
LastWriteTime[
^]). LastAccessTime will only be relevant if it was it's tracking was not deactivated!