Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2004, 11:29 AM
Authorized User
 
Join Date: Jul 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default FileSystemWatcher Problem

Hello Everyone and thanks for your helpin advance. I have written an application that is supposed to watch various folders using the FileSystemWatcher. However, I am running into problems with the event handlers not recognizing the event in the folders consistently. Initially, I had a single Windows form that on the for load called various subroutines that in turn invoked their own FileSystemWatcher object for each direcgtory. For Example:

WatchFolder1()
WatchFolder2() .. etc.

However, this seldom picked up any events. I then removed all but one of the subroutine calls which fixed some of the problems, but not all of them. I really can't figure out what the issue is. The folders being watched basically accept only text and PDF files and the type of file does not seem to effect whether the event fires or not. Additionally, I have another Windows form that monitors another folder on the same machine that seems to work perfectly. There seems to be only two differences with the working and non-working application:

1. The working application emails a link to the new or changed file while the non-working one attaches the file to the email. Could this possibly cause a confilct that maybe the event has fired before the save is complete?

2. The working application monitors only one folder. The non-working one montiors more than one. Could this be causing a thrading problem or some other issue?

I am really confused as to what the problem is. Basically, I need to build a solution that monitors multiple folders for changes and then takes the appropriate action depending on the folder and type of activity. Can someone give a few ideas on how to best accomplish this? I know that one solution could be to have one FileSystemWatcher monitor a folder and it's various subfolders, but that would require me to make everything within the same folder which is not optimal for my solution. Also, it would require quite a bit of parsing. Any feedback on this problem and a possible solution would be greatly appreciated. Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
filesystemwatcher problem (very urgent) shailendra_shail Visual Studio 2005 1 June 29th, 2007 03:56 AM
Using the FileSystemWatcher Control Eyob_the_pro C# 0 January 4th, 2007 03:08 AM
FileSystemWatcher brawny4 Visual Basic 2005 Basics 3 December 28th, 2006 12:47 PM
FileSystemWatcher? [C#] [email protected] General .NET 2 May 13th, 2005 03:50 AM
HELP - FileSystemWatcher Problems [email protected] Pro VB.NET 2002/2003 0 January 10th, 2005 09:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.