Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ErrorEventHandler Delegate

Represents the method that will handle the Error event of a FileSystemWatcher object.

Namespace:  System.IO
Assembly:  System (in System.dll)

type ErrorEventHandler = 
    delegate of  
        sender:Object * 
        e:ErrorEventArgs -> unit


Type: System.Object

The source of the event.

Type: System.IO.ErrorEventArgs

An ErrorEventArgs object that contains the event data.

When you create an ErrorEventHandler delegate, you identify the method that will handle the event. To associate the event with your event-handling method, add an instance of the delegate to the event. The event-handling method is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see Handling and Raising Events.

The following code example shows how to create a FileSystemWatcher object to monitor file changes (creates, deletes, renames, changes) occurring on a disk drive. The example also shows how to properly receive error notifications.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft