FileSystemWatcher doesnt seem to be working on Win7
-
This is the first time i've used a FileSystemWatcher, so i might well be doing something very basic wrong. The code below is what i use to start the FileSystemWatcher.
_fileSystemWatcher = new FileSystemWatcher(path, "*.sql");
_fileSystemWatcher.NotifyFilter = NotifyFilters.LastWrite;
_fileSystemWatcher.Created += new FileSystemEventHandler(FileSystemWatcher_Created);
_fileSystemWatcher.Error += new ErrorEventHandler(FileSystemWatcher_Error);_fileSystemWatcher.EnableRaisingEvents = true;
But, i never seem to get an events raised. The path is set to the correct folder and i am creating files with an sql extension when my program runs, so i thought i would see some info. I am running Win7, if thats any help...
Regards, Gareth. (FKA gareth111)
-
This is the first time i've used a FileSystemWatcher, so i might well be doing something very basic wrong. The code below is what i use to start the FileSystemWatcher.
_fileSystemWatcher = new FileSystemWatcher(path, "*.sql");
_fileSystemWatcher.NotifyFilter = NotifyFilters.LastWrite;
_fileSystemWatcher.Created += new FileSystemEventHandler(FileSystemWatcher_Created);
_fileSystemWatcher.Error += new ErrorEventHandler(FileSystemWatcher_Error);_fileSystemWatcher.EnableRaisingEvents = true;
But, i never seem to get an events raised. The path is set to the correct folder and i am creating files with an sql extension when my program runs, so i thought i would see some info. I am running Win7, if thats any help...
Regards, Gareth. (FKA gareth111)
-
This is the first time i've used a FileSystemWatcher, so i might well be doing something very basic wrong. The code below is what i use to start the FileSystemWatcher.
_fileSystemWatcher = new FileSystemWatcher(path, "*.sql");
_fileSystemWatcher.NotifyFilter = NotifyFilters.LastWrite;
_fileSystemWatcher.Created += new FileSystemEventHandler(FileSystemWatcher_Created);
_fileSystemWatcher.Error += new ErrorEventHandler(FileSystemWatcher_Error);_fileSystemWatcher.EnableRaisingEvents = true;
But, i never seem to get an events raised. The path is set to the correct folder and i am creating files with an sql extension when my program runs, so i thought i would see some info. I am running Win7, if thats any help...
Regards, Gareth. (FKA gareth111)
Hi, but filewatcher costs process overload. why cant you try with API Hooking you can track all the newly opened files and even you can block creating/edit/delete file activities. unless i know the situation for what you are using filewatcher i cant suggest even hooking.
-
Hi, but filewatcher costs process overload. why cant you try with API Hooking you can track all the newly opened files and even you can block creating/edit/delete file activities. unless i know the situation for what you are using filewatcher i cant suggest even hooking.
The app is going to be very small. All it does is watch a folder, if new files are created, alert the user and then the user runs something in the program. At the moment it is using 11k of memory, so i dont think this is an issue. Its also an internal app, so i know what systems it will be run on, and they are fast.
Regards, Gareth. (FKA gareth111)
-
The app is going to be very small. All it does is watch a folder, if new files are created, alert the user and then the user runs something in the program. At the moment it is using 11k of memory, so i dont think this is an issue. Its also an internal app, so i know what systems it will be run on, and they are fast.
Regards, Gareth. (FKA gareth111)
hi, Ya fine ! you are correct, i have given the situation where the file watcher is done for the entire system(all the logical and removable drives) as you mentioned for watching one folder, it wont cost performance issues. do proceed...!