Solved

FileSystemWatcher Missing Events VB.NET

Posted on 2007-04-02
1
312 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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 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 …

743 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

11 Experts available now in Live!

Get 1:1 Help Now