S
Soulless
Hi, I implemented the FileSystemWatcher in an application and on my XP
system it works fine. If I add a file to a directory, it will enable
a button and disable if removed.
On another XP system it does not work in a consistent manner. When
file is created, the button does not enable.
I am wondering about this behaviour and if there is a possible known
issue.. perhaps I am not implementing something correctly.
Here is an example of my code:
// Watch for created files
FileSystemWatcher fileCreatedWatcher = new
FileSystemWatcher(@textBoxWorkingFolder.Text);
// type of change to watch for
fileCreatedWatcher.NotifyFilter = NotifyFilters.FileName;
// delegate to handle the event
fileCreatedWatcher.Created += new
FileSystemEventHandler(this.OnFileCreated);
// begin watching
fileCreatedWatcher.EnableRaisingEvents = true;
Seems simple enough, but only works for me currently.
system it works fine. If I add a file to a directory, it will enable
a button and disable if removed.
On another XP system it does not work in a consistent manner. When
file is created, the button does not enable.
I am wondering about this behaviour and if there is a possible known
issue.. perhaps I am not implementing something correctly.
Here is an example of my code:
// Watch for created files
FileSystemWatcher fileCreatedWatcher = new
FileSystemWatcher(@textBoxWorkingFolder.Text);
// type of change to watch for
fileCreatedWatcher.NotifyFilter = NotifyFilters.FileName;
// delegate to handle the event
fileCreatedWatcher.Created += new
FileSystemEventHandler(this.OnFileCreated);
// begin watching
fileCreatedWatcher.EnableRaisingEvents = true;
Seems simple enough, but only works for me currently.