DriveInformation
Details of one entry of a BinaryImageComboBox drive list: its path, volume label, display name and type,
and the file-system limits Windows reports for it.
public class DriveInformation
Remarks
Passed to DriveSelectionChanged handlers. The values are read when the drive list is built, so they
describe the drive at that moment.
The first entry of the list is the computer itself ("This PC"): its DrivePathString is empty and its
numbers are 0. A drive with no medium, such as an empty card reader, has an empty volume label and zero numbers.
Members at a glance
| Properties | |
|---|---|
DriveDisplayName | Gets or sets the name the list shows for the entry, as Windows Explorer shows it – for example "Local Disk (C:)". |
DrivePathString | Gets the root path of the drive, such as C:\. |
DriveSerialNumber | Gets or sets the serial number Windows assigned to the volume when it was formatted. |
DriveTypeString | Gets or sets the kind of drive, as the Windows shell describes it – for example "Local Disk" or "CD Drive". |
DriveVolumeName | Gets the drive's volume label, such as "Windows" or "Backup". |
FileSystemName | Gets or sets a file-system description of the entry. |
MaxFileNameLength | Gets or sets the longest file or folder name, in characters, the drive's file system accepts. |
Properties
DriveDisplayName
Gets or sets the name the list shows for the entry, as Windows Explorer shows it – for example "Local Disk (C:)".
- Value
- The display name from the Windows shell.
DrivePathString
Gets the root path of the drive, such as C:\.
- Value
- The root path; an empty string for the entry that stands for the computer itself.
DriveSerialNumber
Gets or sets the serial number Windows assigned to the volume when it was formatted.
- Value
- The volume serial number; 0 when it could not be read.
Remarks
Explorer and dir show it in hexadecimal, as two groups of four digits: format it with
ToString("X8") to compare.
DriveTypeString
Gets or sets the kind of drive, as the Windows shell describes it – for example "Local Disk" or "CD Drive".
- Value
- The type description; an empty string for the entry that stands for the computer itself.
DriveVolumeName
Gets the drive's volume label, such as "Windows" or "Backup".
- Value
- The volume label, or an empty string when the drive has none or no medium. For the entry that stands for the computer itself it is "My Computer".
FileSystemName
Gets or sets a file-system description of the entry.
- Value
- For the entry that stands for the computer itself, the shell's type description of it (for example "System Folder"); for a drive, an empty string.
Remarks
The drive list does not record a drive's file system (NTFS, FAT32 and so on) here.
MaxFileNameLength
Gets or sets the longest file or folder name, in characters, the drive's file system accepts.
- Value
- The maximum name length, typically 255; 0 when it could not be read.