473,545 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileSystemWatch er.Filter

anyone know how to filter different file types ie .jpg .gif in
FileSystemWatch er.Filter?

Ian

--
"Life should NOT be a journey to the grave
with the intention of arriving safely in an
attractive and well preserved body,
but rather to skid in sideways,
chocolate in one hand, beer in the other,
body thoroughly used up,
totally worn out and screaming
WOO HOO what a ride!"
Nov 16 '05 #1
2 4734
I don't think you can. The filter is limited to one type although as you
probably know you can at least use wildcards.
You will have to leave the filter blank to include everything and test for
the file extension yourself in the fired event.

"Ian Frawley" <ch****@away.co m> wrote in message
news:gI******** *******@news-1.opaltelecom.n et...
anyone know how to filter different file types ie .jpg .gif in
FileSystemWatch er.Filter?

Ian

--
"Life should NOT be a journey to the grave
with the intention of arriving safely in an
attractive and well preserved body,
but rather to skid in sideways,
chocolate in one hand, beer in the other,
body thoroughly used up,
totally worn out and screaming
WOO HOO what a ride!"

Nov 16 '05 #2
Damn I gathered that was the case. Never mind.
Thanks

Ian

"nevin" <ne***@myself.c om> wrote in message
news:41******** *************@m ercury.nildram. net...
I don't think you can. The filter is limited to one type although as you
probably know you can at least use wildcards.
You will have to leave the filter blank to include everything and test for
the file extension yourself in the fired event.

"Ian Frawley" <ch****@away.co m> wrote in message
news:gI******** *******@news-1.opaltelecom.n et...
anyone know how to filter different file types ie .jpg .gif in
FileSystemWatch er.Filter?

Ian

--
"Life should NOT be a journey to the grave
with the intention of arriving safely in an
attractive and well preserved body,
but rather to skid in sideways,
chocolate in one hand, beer in the other,
body thoroughly used up,
totally worn out and screaming
WOO HOO what a ride!"


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1518
by: Ryan Rogers | last post by:
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...
1
5869
by: Shmulik | last post by:
How can I (can I?) use a regular expression as the filter to a FileSystemWatcher? I want to watch for something like this: Regex regex = new Regex(@"^Current(One|Two|Three)File\.txt$", RegexOptions.IgnoreCase); That is, is the file CurrentOneFile.txt, CurrentTwoFile.txt, etc. shows in in the directory I'm watching, then I can take...
1
3317
by: Troy Murphy | last post by:
How do I prevent the FileSystemWatcher event to keep firing while the file is being created? When copying a file to the watched folder, the event fires a dozen or more times! Also, the documentation states that if more than one file is copied to the folder at the same time, a cache will queue them up for processing, but when I drop 3 files...
1
6421
by: eyal | last post by:
Hi, I'm trying to do this: private void SetNF(FileSystemWatcher fsw,int val){ if( (val&4)!=0 ) fsw.NotifyFilter |= System.IO.NotifyFilters.Attributes; // i'v tried this also: // if( (val&4)!=0 ) fsw.NotifyFilter = System.IO.NotifyFilters.Attributes;
2
4492
by: John Lee | last post by:
Hi, I wrote a small program that copy a list of files to a specified folder one by one, i.e. this app will copy one file into the specified folder and wait until it's consumed (deleted) then copy another one in. Here is what my code: // other codes to get a list of files while (morefiles) {
0
263
by: Eric Wong | last post by:
I am experiencing a bizarre problem using FileSystemWatcher... I have an application that uses multiple FileSystemWatcher to watch for particular files on a network drive. FSW_A uses a filter of \\server\path\foo* and FSW_B uses a filter of \\server\path\bar*. Now FSW_A is really looking for 2 files, foo1yyyymmdd and foo2yyyymmdd while...
7
4511
by: Frank | last post by:
Hi, I am using FileSystemWatcher to track the change in a text file. Whenever I run the program I get 99% CPU utilization. The code doesn't do anything just sits and waits in a while loop until the event is fired. Any ideas? Thanks Frank
12
7423
by: ljh | last post by:
Has anyone else noticed that the FileSystemWatcher raises the changed event twice when a file is changed? Do you have any idea why this is the case?
3
9790
by: emailtonitin | last post by:
I am facing a design issue in my code related to the filesystemwatcher's filter property. I figured out that the filter won't accept multiple patterns for eg. "*.txt, *.csv" don't work. To workaround this issue, I have 2 options: 1. To create multiple instances of filesystemwatcher class and hook all of them to the same event handlers. 2....
5
24103
by: Goran Djuranovic | last post by:
Hi all, I have a file system watcher service that works fine on a local hard drive, but will not work across the network. I tried both: mapping the drive and "\\..." path both no luck. I don't receive any errors, it is just that FileSystemWatcher doesn't see any files dropped in the folder. What could be wrong? Thanks Goran
0
7420
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7446
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6003
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3476
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.