Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
736
|
Chapter 12: Filesystem I/O
Discussion
Watching for changes in the filesystem centers around the FileSystemWatcher class.
This class can watch for filesystem changes on the local machine, a networked drive,
and even a remote machine. The limitations of watching files on a remote machine
are that the watching machine must be running versions of Windows starting from
Windows NT 4.0 through 2000, XP, Server 2003, and Windows Vista. The one
caveat for Windows NT 4.0 is that a Windows NT 4.0 machine cannot watch
another remote Windows NT 4.0 machine.
The
FileSystemWatcher object cannot watch directories or files on a CD or DVD
drive (including rewritables) in the current versions of the Framework. This limita-
tion might be revisited in a future version. This object does watch files regardless of
whether their hidden property is set.
To start watching a filesystem, we need to create an instance of the
FileSystem-
Watcher
class. After creating the FileSystemWatcher object, we can set its properties in
order to focus our efforts in watching a filesystem. Table 12-10 examines the various
properties that can be set on this object.
Table 12-10. Properties that can be set on the FileSystemWatcher object
Property name Description
Path A path to a directory to watch. The following are some examples ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Joe Mayo
C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata