Solved

FileSystemWatcher Missing Events VB.NET

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

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 post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…

751 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