hi frds ...

I want to notify my application whenver user open any file.
i just want to notify the name of that file, which is opend by user.

how can achive this.

FileSystemWatcher class is not giving this facilities.

I want only notification for opening any file..

please reply whaterver you know.IF any trick or logic is there than also let me know....please ...

8 Years
Discussion Span
Last Post by aryan123

thnks for replying adatapost ...
but filesystemwatcher class only notify about changes in file and rename,delete,updated etc...

If i opened a file and closed without any changes and without doing anything than it's not notifying ...

so wht i want is ... i want notification for opening any file from my computer ... just opening files nothing else ...


FileSystemWatcher notify when any file created,deleted,rename or changed in given directory ...


You skipped links at post #2.

Text from MSDN link -
Changed — raised whenever changes are made to the size, system attributes, last write time, last access time, or security permissions of a directory or file.


as written ...

when last access time changed ...

but when i just open file and close without doing any thing ...
last access time is not going to change ..
is there any setting for this??


from febooti:
For improved file system performance Last Access time update in switched off in Windows Vista by default. Thus, Last Access time attribute is set upon creating file and not changed afterwards even if file is modified. However, it is possible to enable Last Access time updates if necessary.
To enable Last Access time updates open Registry Editor by typing regedit in Search input on Start Menu, locate HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem path entry and change NtfsDisableLastAccessUpdate value data to 0


Accessed : Today, November 25, 2009, 3:18:23 PM

now here time is 3:47 and i openedfile ..
but still showing me .... same as previous


So the registry was already set to zero? If you changed it recently, have you rebooted since?
If that registry value is set then i'm not sure why your files aren't updating : /


as i go through some msdn articlez ....
i come to know that in NTFS file system file last access time is updated per hour.

To speed up the disk access this is updated per hour. thts y file system watcher class is not getting notify ..

if any one having any another solution than please reply ...


yahhh ..
i was knowing this solution but i m not having that much time to understand this, read it and implement.....thtts y i was asking for any other solution if possible ...

but now its okay ....

if i want to do thn i have to do with File System Filter


If you are only tracking files opened within your app you can use the open file dialog. But if you need to track when files are opened outside of the ap thats then only method i've found. Good luck :)


Iam stuck with the same problem..did u get any way to get notification when a file is opened and closed without being modified.Can it be done using filesystemwatcher.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.