FileSystemWatcher

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All
Anyone help me to set multiple drives for FileSystemWatcher component.

FileSystemWatcher watcher=new FileSystemWatcher();
watcher.Path = "c:\"

this is working fine.

If i give
watcher.Path = "c:\,d:\"

its throwing exception. Is there anyway to achive this?

thanks in advance
Raghu.
 
Hi Roger
thanks for your reply. But this solution is not the right for me. Incase if my client has 10 Drives i cannot ask him to create 10 different watchers.
Cannot we setup multiple drives with Path property

Regard
Raghu
 
Hi!

FSW is used to watch and monitor for changes, only one folder (eg. C:\, D:\,
etc). Create multiple watchers for multiple drives.

--
Regards,
Kumar Gaurav Khanna
-----------------------------------------------------------------
Microsoft MVP - C#/.NET, MCSE Windows 2000/NT4, MCP+I
WinToolZone - Spelunking Microsoft Technologies
http://www.wintoolzone.com/
OpSupport - Spelunking Rotor
http://opsupport.sscli.net/
Bangalore .NET Users' Group
http://groups.msn.com/bdotnet/
 
Hi Raghu!

The watcher is based upon the FindFirstChangeNotification Win32 API, and
that itself allows to monitor only a single folder and its subtree. Thus,
you will need a seperate watcher for each root drive folder.

--
Regards,
Kumar Gaurav Khanna
-----------------------------------------------------------------
Microsoft MVP - C#/.NET, MCSE Windows 2000/NT4, MCP+I
WinToolZone - Spelunking Microsoft Technologies
http://www.wintoolzone.com/
OpSupport - Spelunking Rotor
http://opsupport.sscli.net/
Bangalore .NET Users' Group
http://groups.msn.com/bdotnet/
raghu said:
Hi Rogers
thanks for your reply. But this solution is not the right for me. Incase
if my client has 10 Drives i cannot ask him to create 10 different watchers.
 
Back
Top