473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

filesystemwatcher file access

Hi
Is it possible to add more events to the FileSystemWatcher object than the
standard create, change, delete and rename? I want to use it to watch if
anyone opens or accesses a file?

regards
Lars Nielsen
Nov 15 '05 #1
2 2250
Hello

Add NotifyFilters.LastAccess flag to NotifyFilter property for
FileSystemWatcher. I think this is what you want.

Best regards
Sherif

"Lars Nielsen" <ln********@videnfabrikken.dk> wrote in message
news:bq**********@news.cybercity.dk...
Hi
Is it possible to add more events to the FileSystemWatcher object than the
standard create, change, delete and rename? I want to use it to watch if
anyone opens or accesses a file?

regards
Lars Nielsen

Nov 15 '05 #2
Hi Lars,

IIRC if you open a file the last access time will change, if so you can use
the Changed event of the FileSystemWatcher to detect it, if so you can use
FileSystemEventArgs.ChangeType track it, What I don't know for sure is if
you can filter an open operation from the rest of the changes detected.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Lars Nielsen" <ln********@videnfabrikken.dk> wrote in message
news:bq**********@news.cybercity.dk...
Hi
Is it possible to add more events to the FileSystemWatcher object than the
standard create, change, delete and rename? I want to use it to watch if
anyone opens or accesses a file?

regards
Lars Nielsen

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rich Miller | last post by:
Previously posted on the VB newsgroup with no replies, so any ideas appreciated. I have written a service application in VB (VS.Net 2003). On start, the service creates an object that...
1
by: Troy Murphy | last post by:
How do I prevent the FileSystemWatcher event to keep firing while the file is being created? When copying a file to the watched folder, the event fires a dozen or more times! Also, the...
1
by: Andreas | last post by:
Hi, we have some problems with the following situation: A remote application A writes files to a directory monitored by a FileSystemWatcher-instance in application B. A creates the file with...
2
by: Steel City Phantom | last post by:
i am building a content distribution system using the filesystemwatcher to catch people moving files in and out of the system and update a database. what happens is when a process runs that moves...
1
by: Phil396 | last post by:
I have a windows service that uses a filesystemwatcher to wait for files and process them to a database. Sometimes a large group of files will be cut and paste for the filesystemwatcher to...
9
by: Tushar | last post by:
Followup-To: microsoft.public.dotnet.general Does anyone know when is this event raised, is it: 1) When the file is created but may not have been closed 2) When the file is created AND it has...
5
by: ZWeng | last post by:
I created a windows service using FileSystemWatcher to moniter a folder for file drops. The service uses FileStream and StreamReader to read and process the file. After it is done, the file is...
2
by: Steve | last post by:
I have a FileSystemWatcher watching a directory where I will add and update files. When it detects a change, I search through all the files and update my list of files in the UI. This works fine....
1
by: Mahita | last post by:
Hi, I am coding a Windows Service in which I am using the "OnCreated" event of FileSystemWatcher class to do some processing when a new file is created in a particular folder. However I have...
5
by: Goran Djuranovic | last post by:
Hi all, I have a file system watcher service that works fine on a local hard drive, but will not work across the network. I tried both: mapping the drive and "\\..." path both no luck. I don't...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.