Skip to content

Disk information library supported NVMs, SATA, USB(SAT12 only).

License

Notifications You must be signed in to change notification settings

usausa/hardwareinfo-disk

Repository files navigation

Disk information library

Package Info
HardwareInfo.Disk NuGet

Supported

Type Support
NVMe
SATA
USB(SAT12 only)

Usage

using HardwareInfo.Disk;

foreach (var disk in DiskInfo.GetInformation())
{
    Console.WriteLine(disk.Model);

    if (disk.SmartType == SmartType.Nvme)
    {
        var smart = (ISmartNvme)disk.Smart;

        Console.WriteLine($"Temperature: {smart.Temperature}");
    }
    else if (disk.SmartType == SmartType.Generic)
    {
        var smart = (ISmartGeneric)disk.Smart;

        Console.WriteLine($"Temperature: {smart.GetAttribute(SmartId.Temperature).RawValue & 0xFF}");
    }
}

Globalt tool

Install

> dotnet tool install -g HardwareInfo.Disk.Tool

Usage

Run as administrator.

diskinfo

Link

About

Disk information library supported NVMs, SATA, USB(SAT12 only).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages