HypernovaDesktop Components · docs
Binarymission
WinForms › Combo Box › DriveInformation

DriveInformation

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.ListControls

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
DriveDisplayNameGets or sets the name the list shows for the entry, as Windows Explorer shows it – for example "Local Disk (C:)".
DrivePathStringGets the root path of the drive, such as C:\.
DriveSerialNumberGets or sets the serial number Windows assigned to the volume when it was formatted.
DriveTypeStringGets or sets the kind of drive, as the Windows shell describes it – for example "Local Disk" or "CD Drive".
DriveVolumeNameGets the drive's volume label, such as "Windows" or "Backup".
FileSystemNameGets or sets a file-system description of the entry.
MaxFileNameLengthGets or sets the longest file or folder name, in characters, the drive's file system accepts.

Properties

DriveDisplayName

public string 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

public string 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

public uint 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

public string 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

public string 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

public string 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

public uint 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.