I think your main problem is your filter string is incorrect and you need to
create multiple FileSystemWatcher objects to achieve your goal. Here is
some sample code.
watcher1 = new FileSystemWatcher(Application.StartupPath);
watcher2 = new FileSystemWatcher(Application.StartupPath);
watcher1.Filter = "*.p*";
watcher2.Filter = "*.f*";
watcher1.EnableRaisingEvents = true;
watcher2.EnableRaisingEvents = true;
watcher1.Created += new FileSystemEventHandler(this.HandleFileCreatedEvent);
watcher2.Created += new FileSystemEventHandler(this.HandleFileCreatedEvent);
watcher1.Deleted += new FileSystemEventHandler(this.HandleFileDeletedEvent);
watcher2.Deleted += new FileSystemEventHandler(this.HandleFileDeletedEvent);
--
Jared Parsons [MSFT]
(E-Mail Removed)
This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
"Ryan Rogers" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The FileSystemWatcher Class has a filter property where you can tell it
what
> files you want it to watch for. I need it to watch for *.p** and *.f**
> files both and have tried giving the filter the following strings
> "*.p**;*.f**" and "*.p**,*.f**" and Each one on its own. Only when I
supply
> each one on its own does it pick up anything. My way around this was to
> just use an if statement in the event triggers to look at the filename
there
> and drop it if its not what I want. I'm wondering if there is a better
way?
> Do I have the filter String Syntax wrong?
>
> Ryan Rogers
>
>