[SerializableAttribute]
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class HardDriveInfo
<SerializableAttribute>
<TypeConverterAttribute(GetType(ExpandableObjectConverter))>
Public Class HardDriveInfo
Dim instance As HardDriveInfo
[SerializableAttribute]
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public ref class HardDriveInfo
[<SerializableAttribute>]
[<TypeConverterAttribute(typeof(ExpandableObjectConverter))>]
type HardDriveInfo = class end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Dim hdds As IEnumerable(Of HardDriveInfo) = HardDriveInfo.GetDrives()
For Each hdd As HardDriveInfo In hdds
' System.IO.DriveInfo properties
Console.WriteLine("{0}: {1}", NameOf(hdd.Name), hdd.Name)
Console.WriteLine("{0}: {1}", NameOf(hdd.RootDirectory), hdd.RootDirectory.FullName)
Console.WriteLine("{0}: {1}", NameOf(hdd.VolumeLabel), hdd.VolumeLabel)
Console.WriteLine("{0}: {1}", NameOf(hdd.DriveFormat), hdd.DriveFormat)
Console.WriteLine("{0}: {1}", NameOf(hdd.IsReady), hdd.IsReady)
Console.WriteLine("{0}: {1}", NameOf(hdd.TotalSize), hdd.TotalSize)
Console.WriteLine("{0}: {1}", NameOf(hdd.AvailableFreeSpace), hdd.AvailableFreeSpace)
Console.WriteLine("{0}: {1}", NameOf(hdd.TotalFreeSpace), hdd.TotalFreeSpace)
' Win32_DiskDrive properties
Console.WriteLine("{0}: {1}", NameOf(hdd.BytesPerSector), hdd.BytesPerSector)
Console.WriteLine("{0}: {1}", NameOf(hdd.Capabilities), String.Join(", ", hdd.Capabilities))
Console.WriteLine("{0}: {1}", NameOf(hdd.DeviceId), hdd.DeviceId)
Console.WriteLine("{0}: {1}", NameOf(hdd.FirmwareRevision), hdd.FirmwareRevision)
Console.WriteLine("{0}: {1}", NameOf(hdd.Index), hdd.PhysicalIndex)
Console.WriteLine("{0}: {1}", NameOf(hdd.InterfaceType), hdd.InterfaceType)
Console.WriteLine("{0}: {1}", NameOf(hdd.MediaType), hdd.MediaType.ToString())
Console.WriteLine("{0}: {1}", NameOf(hdd.Model), hdd.Model)
Console.WriteLine("{0}: {1}", NameOf(hdd.Partitions), hdd.Partitions)
Console.WriteLine("{0}: {1}", NameOf(hdd.PnpDeviceId), hdd.PnpDeviceId)
Console.WriteLine("{0}: {1}", NameOf(hdd.SectorsPerTrack), hdd.SectorsPerTrack)
Console.WriteLine("{0}: {1}", NameOf(hdd.SerialNumber), hdd.SerialNumber)
Console.WriteLine("{0}: {1}", NameOf(hdd.TotalCylinders), hdd.TotalCylinders)
Console.WriteLine("{0}: {1}", NameOf(hdd.TotalHeads), hdd.TotalHeads)
Console.WriteLine("{0}: {1}", NameOf(hdd.TotalSectors), hdd.TotalSectors)
Console.WriteLine("{0}: {1}", NameOf(hdd.TotalTracks), hdd.TotalTracks)
Console.WriteLine("{0}: {1}", NameOf(hdd.TracksPerCylinder), hdd.TracksPerCylinder)
' S.M.A.R.T. Attributes
Console.WriteLine()
Console.WriteLine("S.M.A.R.T. Attributes:")
Dim sb As New StringBuilder()
For Each attr As SmartAttribute In hdd.SMART.Attributes
sb.AppendFormat("Id: {0:X2}, Name: {1,-30}, Current: {2,3}, Worst: {3,3}, Threshold: {4,3}, RAW: {5,12:X12}, IsHealthOk?: {6}",
attr.Id, attr.Name,
attr.CurrentValue, attr.WorstValue, attr.Threshold, attr.RawValue32,
attr.IsHealthOk)
sb.AppendLine()
Next
Console.WriteLine(sb.ToString())
Console.WriteLine()
Next hdd
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
HardDriveInfo(Char) | Initializes a new instance of the HardDriveInfo class. |
HardDriveInfo(DriveInfo) | Initializes a new instance of the HardDriveInfo class. |
AvailableFreeSpace | Gets the amount of available free space on a drive, in bytes. |
BytesPerSector | Gets the mumber of bytes in each sector for the physical disk drive. |
Capabilities | Gets the capabilities (such as S.M.A.R.T. notification) of the hard drive. |
CapabilitiesNames | Gets the names of the capabilities (such as S.M.A.R.T. notification) of the hard drive. |
DeviceId | Gets the unique identifier of the disk drive on the system. |
DriveFormat | Gets the name of the file system, such as NTFS or FAT32. |
FirmwareRevision | Gets the revision for the hard drive firmware that is assigned by the manufacturer. |
Index | Gets the physical drive index of the hard drive. |
InterfaceType | Gets the interface type of the hard drive. |
IsReady | Gets a value that indicates whether a drive is ready. |
MediaType | Gets the type of hard drive media. |
Model | Gets the manufacturer's model number of the disk drive. |
Name | Gets the name of the hard drive, such as C:\. |
Partitions | Gets the number of partitions on this hard drive that are recognized by the operating system. |
PnpDeviceId | Gets the Windows Plug and Play (PNP) device identifier of the hard drive. |
RootDirectory | Gets the root directory of the hard drive. |
SectorsPerTrack | Gets the number of sectors in each track for this hard drive. |
SerialNumber | Gets the number allocated by the manufacturer to identify the physical media. |
SMART | Gets the S.M.A.R.T. information of the hard drive. |
TotalCylinders | Gets the total number of cylinders on the hard drive. Note: the value for this property is obtained through extended functions of BIOS interrupt 13h. The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. Consult the manufacturer for accurate drive specifications. |
TotalFreeSpace | Gets the total amount of free space available on a drive, in bytes. |
TotalHeads | Gets the total number of heads on the hard drive. Note: the value for this property is obtained through extended functions of BIOS interrupt 13h. The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. Consult the manufacturer for accurate drive specifications. |
TotalSectors | Gets the total number of sectors on the physical disk drive. Note: the value for this property is obtained through extended functions of BIOS interrupt 13h. The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. Consult the manufacturer for accurate drive specifications. |
TotalSize | Gets the total size of storage space on a drive, in bytes. |
TotalTracks | Gets the total number of tracks on the physical disk drive. Note: the value for this property is obtained through extended functions of BIOS interrupt 13h. The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. Consult the manufacturer for accurate drive specifications. |
TracksPerCylinder | Gets the number of tracks in each cylinder on the physical disk drive. Note: the value for this property is obtained through extended functions of BIOS interrupt 13h. The value may be inaccurate if the drive uses a translation scheme to support high-capacity disk sizes. Consult the manufacturer for accurate drive specifications. |
VolumeLabel | Gets or sets the volume label of the hard drive. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetDrives | Gets all the hard drives of the current machine. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
Refresh | Refreshes the hard drive properties of this instance. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |