473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C# FileSystemWatcher with multi path

Hi,

I need to detect changes on several directory at the same time.

for example: D:\temp c:\docs and so on.
the problem is that this component have 1 'Path' in it's attribute.
how can i solve this problem?

i'm using C# ( and i'm new to this language )

Please help.
Nov 16 '05 #1
4 3006
Eyal,

In order to get around this, you have to have multiple instances of the
FileSystemWatcher class, each pointing to a different path to watch.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"eyal" <st******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
Hi,

I need to detect changes on several directory at the same time.

for example: D:\temp c:\docs and so on.
the problem is that this component have 1 'Path' in it's attribute.
how can i solve this problem?

i'm using C# ( and i'm new to this language )

Please help.

Nov 16 '05 #2
eyal wrote:
I need to detect changes on several directory at the same time.

for example: D:\temp c:\docs and so on.
the problem is that this component have 1 'Path' in it's attribute.
how can i solve this problem?


Use a distinct instance of FileSystemWatcher for each directory (unless you
have to watch all subdirs of a given directory; in this case you can use a
single FileSystemWatcher).
Nov 16 '05 #3
Hi,

You have to use one instance for each directory.
What you can do is use the same method to handle the events from ALL the
instances.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"eyal" <st******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
Hi,

I need to detect changes on several directory at the same time.

for example: D:\temp c:\docs and so on.
the problem is that this component have 1 'Path' in it's attribute.
how can i solve this problem?

i'm using C# ( and i'm new to this language )

Please help.

Nov 16 '05 #4
Thanks a lot.
"Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT dot.state.fl.us> wrote in message news:<#l**************@TK2MSFTNGP09.phx.gbl>...
Hi,

You have to use one instance for each directory.
What you can do is use the same method to handle the events from ALL the
instances.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"eyal" <st******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
Hi,

I need to detect changes on several directory at the same time.

for example: D:\temp c:\docs and so on.
the problem is that this component have 1 'Path' in it's attribute.
how can i solve this problem?

i'm using C# ( and i'm new to this language )

Please help.

Nov 16 '05 #5

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

Similar topics

1
by: Rich Miller | last post by:
Previously posted on the VB newsgroup with no replies, so any ideas appreciated. I have written a service application in VB (VS.Net 2003). On start, the service creates an object that...
1
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...
0
by: zfeld | last post by:
My program has two instances of a control have fileSystemWatchers that are set to monitor the same directory for changes. When they are watching a directory on the local machine, it works fine, two...
13
by: David | last post by:
I have been working on trying to write a directory watcher service. One of the requirments is that it be able to watch multiple directories, not sub directories of one parent directory, but just...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
1
by: PadovaBoy | last post by:
Hi! I try to develop a simple system for monitoring a sub directory of a web site and remake an xml file every time a sub-dir change it's name. I don't wont to use a window.service because, i want...
12
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?
5
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...
1
by: teslar91 | last post by:
I've been learning VB.NET for the past few weeks. One of the problems I've run into is difficulties updating controls in events from certain components, such as the FileSystemWatcher, that raise...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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,...

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.