Package | Info |
---|---|
HardwareInfo.Disk |
Type | Support |
---|---|
NVMe | ✅ |
SATA | ✅ |
USB(SAT12 only) | ✅ |
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}");
}
}
> dotnet tool install -g HardwareInfo.Disk.Tool
Run as administrator.
diskinfo