DelphiBasics
  Home  |  Delphi .net Home  |  System.IO NameSpace
 .NET Framework
 Namespace References

 System
 System.Collections
 System.Globalization
 System.IO
 
  BinaryReader  Class 
  BinaryWriter  Class 
  BufferedStream  Class 
  Directory  Class 
  DirectoryInfo  Class 
  File  Class 
  FileAccess  Enumeration 
  FileAttributes  Enumeration 
  FileInfo  Class 
  FileMode  Enumeration 
  FileShare  Enumeration 
  FileStream  Class 
  FileSystemWatcher  Class 
  MemoryStream  Class 
  Path  Class 
  SeekOrigin  Enumeration 
  StreamReader  Class 
  StreamWriter  Class 
  StringReader  Class 
  StringWriter  Class 

 Articles and Tutorials

 Overview of .NET
 Delphi and .NET
 Winform Applications
 ASP .Net Applications
 php Web Services
 Framework Collections
 Framework String Handling
 Framework Files and Folders


 
 
  System.IO.FileSystemWatcher Class
 
 Description
This is an unusual class! It allows you to be notified when a file or directory (folder) has been created, renamed, changed or deleted. You can even sit and wait for such an activity to take place.
 
This class only works on a remote file system if it is on a Windows NT, 2000 or XP Operating System.
 
Activities for all files are watched unless you specify a string filter to limit the file names. The filter string may use wildcards :
 
Represents 0 or more characters
Represents exactly 1 character
 Syntax
Constructor Create ( );
Constructor Create ( PathString : String ; );
Constructor Create ( PathString : String; Filter : String );
 Methods
OnChanged  A method that is called when a file system change is detected
OnCreated  A method that is called when a file is created
OnDeleted  A method that is called when a file is deleted
OnError  A method that is called when a file system error is detected
OnRenamed  A method that is called when a file is renamed
WaitForChanged  Synchronously wait for a file system change to take place

 Properties
Container  IContainer  Gets the IContainer that contains the Component.
EnableRaisingEvents  Boolean  Gets or sets a value indicating whether the component is enabled.
Filter  String  Gets or sets the filter string, used to determine what files are monitored in a directory.
IncludeSubdirectories  Boolean  Gets or sets a value indicating whether subdirectories within the specified path should be monitored.
InternalBufferSize  Integer  Gets or sets the size of the internal buffer.
NotifyFilter  String  Gets or sets the type of changes to watch for.
Path  String  Gets or sets the path of the directory to watch.
SynchronizingObject  Object  Gets or sets the object used to marshal the event handler calls issued as a result of a directory change.
 Events
Changed  Occurs when a file or directory in the specified Path is changed.
Created  Occurs when a file or directory in the specified Path is created.
Deleted  Occurs when a file or directory in the specified Path is deleted.
Disposed  Adds an event handler to listen to the Disposed event on the component.
Error  Occurs when the internal buffer overflows.
Renamed  Occurs when a file or directory in the specified Path is renamed.

 Microsoft MSDN links
 
System.IO
System.IO.filesystemwatcher
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page