By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,890 Members | 1,112 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,890 IT Pros & Developers. It's quick & easy.

FileSystemWatcher to FileSystemIgnorer

P: n/a
I have a console app that uses FileSystemWatcher to watch for a certain file
to be created, then it reads the data out of the file, inserts it into an
sql database, deletes the file and then resumes watching for it to be
created again.

Every now and then, the FileSystemWatcher stops working (maybe the entire
app, I can't tell). Anyway, the file gets created, the program doesn't see
it. I delete the file manually, and re-create it, nothing. The only fix is
to stop the app and restart it.

I haven't been able to figure out why this might happen. Anyone have any
ideas?

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I've had this happen to me before too. Its not happened for a while though,
maybe I changed code somewhere.
This is my code...

Public WithEvents WatchFolder As FileSystemWatcher

Private Sub FormLoad(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'-----------Some Code Cut---------------
WatchFolder = New FileSystemWatcher
WatchFolder.SynchronizingObject = Me
WatchFolder.Path = textBoxWatchPath.Text
'Add a list of Filter we want to specify. Make sure you use OR for each
Filter as we need to all of these.
WatchFolder.NotifyFilter = IO.NotifyFilters.DirectoryName
WatchFolder.NotifyFilter = WatchFolder.NotifyFilter Or
IO.NotifyFilters.FileName
End Sub
"Terry Olsen" <to******@hotmail.com> wrote in message
news:eg**************@tk2msftngp13.phx.gbl...
I have a console app that uses FileSystemWatcher to watch for a certain
file to be created, then it reads the data out of the file, inserts it into
an sql database, deletes the file and then resumes watching for it to be
created again.

Every now and then, the FileSystemWatcher stops working (maybe the entire
app, I can't tell). Anyway, the file gets created, the program doesn't
see it. I delete the file manually, and re-create it, nothing. The only
fix is to stop the app and restart it.

I haven't been able to figure out why this might happen. Anyone have any
ideas?

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.