Is it possible in the Windows environment to detect if a file is being opened with with .NET
I would like to place a handler on the file system to detect if a file or any file is being opened, is this possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The simplest solution would be to use a
FileSystemWatcherand set the filter toNotifyFilters.LastAccess, which will tell it to watch for a change in the last access date/time.