Hardware.Info.LinuxAndMac
100.0.0
dotnet add package Hardware.Info.LinuxAndMac --version 100.0.0
NuGet\Install-Package Hardware.Info.LinuxAndMac -Version 100.0.0
<PackageReference Include="Hardware.Info.LinuxAndMac" Version="100.0.0" />
<PackageVersion Include="Hardware.Info.LinuxAndMac" Version="100.0.0" />
<PackageReference Include="Hardware.Info.LinuxAndMac" />
paket add Hardware.Info.LinuxAndMac --version 100.0.0
#r "nuget: Hardware.Info.LinuxAndMac, 100.0.0"
#:package Hardware.Info.LinuxAndMac@100.0.0
#addin nuget:?package=Hardware.Info.LinuxAndMac&version=100.0.0
#tool nuget:?package=Hardware.Info.LinuxAndMac&version=100.0.0
Source
This fork of https://github.com/Jinjinov/Hardware.Info/
Hardware.Info.LinuxAndMac
Only Linux and macOS operating system is supported!
Battery, BIOS, CPU - processor, storage drive, keyboard, RAM - memory, monitor, motherboard, mouse, NIC - network adapter, printer, sound card - audio card, graphics card - video card. Hardware.Info is a .NET 5+ library and /dev, /proc, /sys on Linux.
How to use:
Include NuGet package from https://www.nuget.org/packages/Hardware.Info.Linux
<ItemGroup> <PackageReference Include="Hardware.Info.Linux" Version="100.0.0.0" /> </ItemGroup>Call
RefreshAll()or one of the otherRefresh*()methods:class Program { static readonly IHardwareInfo hardwareInfo = new HardwareInfo(); static void Main(string[] _) { //hardwareInfo.RefreshOperatingSystem(); //hardwareInfo.RefreshMemoryStatus(); //hardwareInfo.RefreshBatteryList(); //hardwareInfo.RefreshBIOSList(); //hardwareInfo.RefreshCPUList(); //hardwareInfo.RefreshDriveList(); //hardwareInfo.RefreshKeyboardList(); //hardwareInfo.RefreshMemoryList(); //hardwareInfo.RefreshMonitorList(); //hardwareInfo.RefreshMotherboardList(); //hardwareInfo.RefreshMouseList(); //hardwareInfo.RefreshNetworkAdapterList(); //hardwareInfo.RefreshPrinterList(); //hardwareInfo.RefreshSoundDeviceList(); //hardwareInfo.RefreshVideoControllerList(); hardwareInfo.RefreshAll(); Console.WriteLine(hardwareInfo.OperatingSystem); Console.WriteLine(hardwareInfo.MemoryStatus); foreach (var hardware in hardwareInfo.BatteryList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.BiosList) Console.WriteLine(hardware); foreach (var cpu in hardwareInfo.CpuList) { Console.WriteLine(cpu); foreach (var cpuCore in cpu.CpuCoreList) Console.WriteLine(cpuCore); } Console.ReadLine(); foreach (var drive in hardwareInfo.DriveList) { Console.WriteLine(drive); foreach (var partition in drive.PartitionList) { Console.WriteLine(partition); foreach (var volume in partition.VolumeList) Console.WriteLine(volume); } } Console.ReadLine(); foreach (var hardware in hardwareInfo.KeyboardList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.MemoryList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.MonitorList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.MotherboardList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.MouseList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.NetworkAdapterList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.PrinterList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.SoundDeviceList) Console.WriteLine(hardware); foreach (var hardware in hardwareInfo.VideoControllerList) Console.WriteLine(hardware); Console.ReadLine(); foreach (var address in HardwareInfo.GetLocalIPv4Addresses(NetworkInterfaceType.Ethernet, OperationalStatus.Up)) Console.WriteLine(address); Console.WriteLine(); foreach (var address in HardwareInfo.GetLocalIPv4Addresses(NetworkInterfaceType.Wireless80211)) Console.WriteLine(address); Console.WriteLine(); foreach (var address in HardwareInfo.GetLocalIPv4Addresses(OperationalStatus.Up)) Console.WriteLine(address); Console.WriteLine(); foreach (var address in HardwareInfo.GetLocalIPv4Addresses()) Console.WriteLine(address); Console.ReadLine(); } }
Known issues
Settings
Refresh methods settings:
In these two methods you can exclude some slow queries by setting the parameters to false:
RefreshCPUList(bool includePercentProcessorTime = true)
RefreshNetworkAdapterList(bool includeBytesPersec = true, bool includeNetworkAdapterConfiguration = true)
Setting includePercentProcessorTime and includeBytesPersec to false will exclude the queries that:
- cause a 1 second delay every time they are called in Linux
Setting includeNetworkAdapterConfiguration to false has only a small impact on performance.
Benchmarks
Version history:
- 100.0.0.0
- Fixed
GetCpuListin Linux - thanks to @inelisoni
- Fixed
- 11.1.1.1
- Fixed
GetMonitorListin Windows - by @Geevo
- Fixed
- 11.1.1.0
- Fixed
GetMonitorListin Windows - by @Geevo
- Fixed
- 11.1.0.1
- 11.1.0.0
- Fixed
NetworkAdapter.Speedin Windows - by @isenmann
- Fixed
- 11.0.1.1
- Added
Keyboardinfo in Linux - Added
Mouseinfo in Linux - Added
SoundDeviceinfo in Linux - Added
VideoController.CurrentHorizontalResolutionin Linux - Added
VideoController.CurrentVerticalResolutionin Linux - Added
VideoController.CurrentRefreshRatein Linux
- Added
- 11.0.1.0
- Fixed
VideoController.AdapterRAMin Windows - by @jesperll
- Fixed
- 11.0.0.1
- Added
L1DataCacheSizeandL1InstructionCacheSizein Windows, macOS, Linux - Fixed
L2CacheSizeandL3CacheSizein Windows, Linux
- Added
- 11.0.0.0
- Fixed
GetNetworkAdapterListin Windows - thanks to @isenmann
- Fixed
- 10.1.1.1:
- Fixed
CurrentClockSpeedin Windows - thanks to @jason-c-daniels
- Fixed
- 10.1.1.0:
- Fixed
GetCpuUsagein Linux - thanks to @glebov21
- Fixed
- 10.1.0.1:
- Fixed
CPU.NameandCPU.CurrentClockSpeedin macOS - by @davidaramant - Added
CPU.MaxClockSpeedin macOS - by @davidaramant
- Fixed
- 10.1.0.0:
- Fixed
PercentProcessorTimein Windows - thanks to @C6OI
- Fixed
- 10.0.1.1:
- Added
GetOperatingSystem()in Windows, macOS, Linux - thanks to @adhip94
- Added
- 10.0.1.0:
- Added
GetBatteryList()in macOS - by @Tadelsucht
- Added
- 10.0.0.1:
- Fixed
GetBatteryList()in Linux - by @Tadelsucht
- Fixed
- 10.0.0.0:
- Fixed
GetDriveList()andGetMemoryList()in Linux - thanks to @misaka00251
- Fixed
- 1.1.1.1:
- Added
Memory.BankLabel,Memory.MinVoltage,Memory.MaxVoltagein Windows - by @AathifMahir - Added
CPU.SocketDesignation,CPU.SecondLevelAddressTranslationExtensionsin Windows - by @AathifMahir - Added Windows version check for WMI properties that require at least Windows 8
- Added Windows version check for WMI properties that require at least Windows 10
- Added XML summary for public properties in every class.
- Added
- 1.1.1.0:
- Added
IHardwareInfoso thatHardwareInfocan be mocked - by @240026763
- Added
- 1.1.0.1:
- Added two settings for WMI queries in Windows
- Added three settings to exclude slow queries in Windows, macOS, Linux
- 1.1.0.0:
- Fixed reading
MemAvailableinstead ofMemFreein Linux - by @schotime
- Fixed reading
- 1.0.1.1:
- 1.0.1.0:
- 1.0.0.1:
- Added
Battery.EstimatedChargeRemainingin Windows, Linux - by @reptail
- Added
- 1.0.0.0:
- Added
Battery.ExpectedLifein Linux - Added
Battery.EstimatedRunTimein Linux - Added
Battery.MaxRechargeTimein Linux - Added
Battery.TimeToFullChargein Linux
- Added
- 0.1.1.1:
- Added
Battery.DesignCapacityin Linux - Added
Battery.FullChargeCapacityin Linux
- Added
- 0.1.1.0:
- Added
Battery.BatteryStatusDescriptionin Linux
- Added
- 0.1.0.1:
- Added
Monitorinfo in macOS - Added
VideoControllerinfo in macOS
- Added
- 0.1.0.0:
- Added
CPU.L2CacheSizein macOS - Added
CPU.L3CacheSizein macOS - Added
Memoryinfo in macOS
- Added
- 0.0.1.1:
- Added
BIOS.ReleaseDatein Linux - Added
CPU.Manufacturerin Linux - Added
CPU.L3CacheSizein Linux - Added
Motherboard.SerialNumberin Linux - Fixed
NetworkAdapterinfo in Linux - Fixed
GetLocalIPv4Addresses()in macOS
- Added
- 0.0.1.0:
- Added
GetLocalIPv4Addresses()in Windows, macOS, Linux - Added
Motherboard.SerialNumberin Windows - Added
Drive,NetworkAdapterinfo in macOS, Linux
- Added
- 0.0.0.1:
- All hardware info in Windows
- CPU, RAM info in macOS, Linux
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 100.0.0 | 871 | 11/24/2023 |