Around and About .NET World

Il blog di Marco Minerva
posts - 1671, comments - 2232, trackbacks - 2135

My Links

News

Contattami su Live Messenger:


MCTS: Windows, Web, Distributed Applications & SQL Server

MCPD: Enterprise Applications

Tag Cloud

Archives

Post Categories

Links

FileSystemWatcher ed eventi generati più volte

Il FileSystemWatcher ha un comportamento che, all'apparenza, può far pensare ad un bug: alcuni eventi, come OnChanged e OnCreated, vengono generati più volte. In realtà, questo comportamento è normale. Come viene indicato da MSDN:

Common file system operations might raise more than one event. For example, when a file is moved from one directory to another, several OnChanged and some OnCreated and OnDeleted events might be raised. Moving a file is a complex operation that consists of multiple simple operations, therefore raising multiple events. Likewise, some applications (for example, antivirus software) might cause additional file system events that are detected by FileSystemWatcher.

In questo post, inoltre, viene spiegato perché l'evento OnChanged viene generato due volte quando si salva un file utilizzando Notepad.

Print | posted on Sunday, April 1, 2007 12:16 PM | Filed Under [ C# VB .NET ]

Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET