Hallo
Kann mir jemand weiterhelfen und mir einen Tipp geben, wie ich den filewatcher
so konfigurieren kann, dass wenn eine bestimmte Datei �ndert, nur einmal
"change" gefeuert wird?
Es wird so n�mlich zweimal gefeuert...
Vielen Dank
Patrik
Mein Code:
...
watcher = new FileSystemWatcher();
watcher.Path = "e:\\filewatcher";
/* Watch for changes in LastAccess and LastWrite times, and
the renaming of files or directories. */
watcher.NotifyFilter = NotifyFilters.LastWrite;
// Only watch text files.
watcher.Filter = "watcher.txt";
// Add event handlers.
watcher.Changed += new FileSystemEventHandler(OnChanged);
// Begin watching.
watcher.EnableRaisingEvents = true;
...
// Define the event handlers.
private static void OnChanged(object source, FileSystemEventArgs e) {
// Specify what is done when a file is changed, created, or
deleted.
System.Diagnostics.EventLog el = new
System.Diagnostics.EventLog();
el.Source = "Service Watcher";
el.WriteEntry("File: " + e.FullPath + " " + e.ChangeType + "
" + e.Name);
}
_______________________________________________
CSharp.net Mailingliste, Postings senden an:
[EMAIL PROTECTED]
An-/Abmeldung und Suchfunktion unter:
http://www.glengamoi.com/mailman/listinfo/csharp.net