Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FileSystemWatcher Missing Events VB.NET

Posted on 2007-04-02
1
Medium Priority
?
373 Views
Last Modified: 2012-06-21
I have an application that makes use of the FileSystemWatcher (FSW) class in a VB.NET windows application.

.NET 2 is being used on an XP machine.

The purpose of this application is to monitor certain directories with the FSW class and update a User Interface (UI) with the names of the files that are currently in that particular directory. I am currently using the ListView object on the UI to show the contents of the directory.
A problem seems to arise when I add (or delete) a large number of files from a directory and the ListVeiw does not update correctly...  i am guessing that some of the FSW events are not being raised but cannot be sure.

Does anyone have any suggestions that would make the ListView update in "real-time" when large numbers of files are deleted or added?

Any help would be much appreciated.
Thanks in advance
0
Comment
Question by:MTSDL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
ksaul earned 2000 total points
ID: 18836332
The FileSystemWatcher class has a buffer that can overflow if too many events happen at once.  You should first see if you can limit the events with a NotifyFilter and IncludeSubdirectories properties of FileSystemWatcher.  You can also increase the InternalBufferSize property (with a performance hit).

http://msdn2.microsoft.com/en-us/library/system.io.filesystemwatcher(VS.80).aspx
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Six Sigma Control Plans

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question