Windows Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileSystemWatcher.WaitForChanged Method (WatcherChangeTypes, Int32)

A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor and the time (in milliseconds) to wait before timing out.

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

public WaitForChangedResult WaitForChanged (
	WatcherChangeTypes changeType,
	int timeout
)
public WaitForChangedResult WaitForChanged (
	WatcherChangeTypes changeType, 
	int timeout
)
public function WaitForChanged (
	changeType : WatcherChangeTypes, 
	timeout : int
) : WaitForChangedResult
Not applicable.

Parameters

changeType

The WatcherChangeTypes to watch for.

timeout

The time (in milliseconds) to wait before timing out.

Return Value

A WaitForChangedResult that contains specific information on the change that occurred.

This method waits until a change occurs or it has timed out. A value of -1 for the timeout parameter means wait indefinitely.

NoteNote:

This method allows an event handler to be invoked to respond to file changes even if the EnableRaisingEvents property is set to false.

In some systems, FileSystemWatcher reports changes to files using the short 8.3 file name format. For example, a change to "LongFileName.LongExtension" could be reported as "LongFi~.Lon".

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

Show:
© 2015 Microsoft