473,322 Members | 1,538 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,322 software developers and data experts.

FileSystemWatcher to FileSystemIgnorer

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
1 1516
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
7
by: Allen Anderson | last post by:
I'm trying to figure out a way to catch when a file has been written to a directory. I currently have it where I can catch when the file begins writing, but this isn't helpful as I need to know...
2
by: Jet Leung | last post by:
Hi all, I had made a program to watching files in my directory. I had used a instance of FileSystemWatcher to do my work.And I had add some events of the FileSystemWatcher , for example onChange,...
13
by: David | last post by:
I have been working on trying to write a directory watcher service. One of the requirments is that it be able to watch multiple directories, not sub directories of one parent directory, but just...
3
by: Stampede | last post by:
Hi, I want to use the FileSystemWatcher in a Windows Service. I read an article, where the author created the FileSystemWatcher object in a seperate thread and when the event is fired, he started...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
12
by: ljh | last post by:
Has anyone else noticed that the FileSystemWatcher raises the changed event twice when a file is changed? Do you have any idea why this is the case?
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...
5
by: =?Utf-8?B?Sm9obiBT?= | last post by:
I am trying to find out if there is a way to tell if there is already a filesystemwatcher (created by a webservice) monitoring a folder. I have a webservice that creates a filesystemwatcher,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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.