Solved

FileSystemWatcher Missing Events VB.NET

Posted on 2007-04-02
1
341 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
1 Comment
 
LVL 10

Accepted Solution

by:
ksaul earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now