0% found this document useful (0 votes)
9 views

complete-reference-vb_net_50

Uploaded by

khalid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

complete-reference-vb_net_50

Uploaded by

khalid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

FileSystemWatcher

Property Purpose
TotalSize Retrieves the total size of the drive, in bytes
AvailableSpace, FreeSpace Retrieves the amount of space available on the drive, in bytes
DriveLetter, Letter Retrieves the drive letters assigned to the drive
DriveType Retrieves the type of drive (removable, fixed, network, CD−ROM,
or RAM disk)
SerialNumber Retrieves the drive's serial number
FileSystem Retrieves the type of file system on the drive (FAT, FAT32, or
NTFS)
IsReady Used to determine if the drive is available for use
ShareName, VolumeName Provides the name of the share and/or volume
Path, RootFolder Provides the path or root folder of the drive
A Drives object that comes packaged into the FSO model also exposes a Count property and an Item
property. The following code demonstrates how to instantiate the object via the FSO interface and access its
members.

Dim fso As New FileSystemObject()


DriveInfo.Add(fso.Drives.Count())

FileSystemWatcher

Objects of the FileSystemWatcher class watch the file system and report to you the moment a file or folder
changes. There are so many uses for this class that it would be pointless to try and list them all. I have used it
to trigger events that tell my data processing applications that it's time to go to work on a folder and process
files that have changed.

The FileSystemWatcher class lets you also watch for changes in a specified directory on a network drive, or
a remote computer. But before you get caught up in the "novelty" of this class, remember that the "watcher" is
platform−dependent. FileSystemWatcher only works on Windows XP, .NET Server, Windows 2000, and
Windows NT 4.0. Your remote computers must have one of these platforms installed for the component to
function properly. You cannot watch a remote Windows NT 4.0 computer from a Windows NT 4.0 computer.

FileSystemWatcher does not attempt to watch CDs and DVDs, which don't change. Its members are listed in
Table 15−20.

Table 15−20: The Members of the FileSystemWatcher Class

Member Description
Container (p) Retrieves the IContainer that contains the component
EnableRaisingEvents (p) Retrieves or changes a value indicating whether the component is
enabled
Filter (p) Retrieves or changes the filter string, used to determine what files are
monitored in a directory
IncludeSubdirectories (p) Retrieves or changes a value indicating whether subdirectories within the
specified path should be monitored
InternalBufferSize (p) Retrieves or changes the size of the internal buffer

534

You might also like