Re: FileSystemWatcher WinXP versus Win2003
- From: "Ignacio Machin \( .NET/ C# MVP \)" <ignacio.machin AT dot.state.fl.us>
- Date: Mon, 8 May 2006 10:18:59 -0400
Hi,
Maybe your program is getting error when try to access the file ( it may be
still in used by the originator ). What if you put a try/catch with a
message or write to a log if you find a problem.
Also with that set of events you may get duplicated events being fired for
the same file, be aware of that.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Meya-awe" <bramoin@xxxxxxxxx> wrote in message
news:uzVlMVXcGHA.3888@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have a C# program which creates a FileSystemWatcher and sets
IncludeSubdirectories property to true with filter set to "*.txt". The
program runs fine under WinXP but in Win2003, it does not always work.
specifically another program is writing into the directory being
monitored by my app. When i do a copy from command prompt into the
directory, my app picks it up. But when the other app writes a file into
the directory being monitored, my app does not. All the testing i have
done with my app on XP involved the copying of the file or opening it
using notepad and saving it back. The NotifyFilter is set to LastWrite.
But i am capturing the Created and Changed events using:
_fsWatcher.Created += new FileSystemEventHandler(someFunc)
_fsWatcher.Changed += new FileSystemEventHandler(someFunc)
where the someFunc is defined as a private void.
The copy does not work on the Win2003 but when i use notepad to save the
file on win2003, my app sees the event. I want my program to capture the
first time creation of the file on the directory and not when i use
notepad to save it.
Any ideas why the difference?
thanks,
BRAMOIN
*** Sent via Developersdex http://www.developersdex.com ***
.
- References:
- FileSystemWatcher WinXP versus Win2003
- From: Meya-awe
- FileSystemWatcher WinXP versus Win2003
- Prev by Date: Re: NullReferenceException problem working with Dataset
- Next by Date: Re: HTML Validation
- Previous by thread: FileSystemWatcher WinXP versus Win2003
- Next by thread: Porting web navigator from VB6 to VS2005 C#
- Index(es):
Relevant Pages
|