From 10d20085704f401ff5516b824f5ff51a9e04213f Mon Sep 17 00:00:00 2001 From: Urban Date: Mon, 23 Aug 2021 19:50:27 +0200 Subject: [PATCH] Version 1.1.0.1 --- Hardware.Info/Hardware.Info.csproj | 2 +- README.md | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Hardware.Info/Hardware.Info.csproj b/Hardware.Info/Hardware.Info.csproj index 52aed6d..5f43f09 100644 --- a/Hardware.Info/Hardware.Info.csproj +++ b/Hardware.Info/Hardware.Info.csproj @@ -9,7 +9,7 @@ Hardware.Info Hardware.Info - 1.1.0.0 + 1.1.0.1 Jinjinov 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 Standard 2.0 library and uses WMI on Windows, /dev, /proc, /sys on Linux and sysctl, system_profiler on macOS. Computer;Device;Hardware;Info;Information;NET Standard;Windows;Linux;macOS diff --git a/README.md b/README.md index ebae8ef..907a39f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Battery, BIOS, CPU - processor, storage drive, keyboard, RAM - memory, monitor, 1. Include NuGet package from https://www.nuget.org/packages/Hardware.Info - + 2. Call `RefreshAll()` or one of the other `Refresh*()` methods: @@ -117,8 +117,33 @@ Battery, BIOS, CPU - processor, storage drive, keyboard, RAM - memory, monitor, } } +## Settings + +### Constructor settings: + +``` +HardwareInfo(bool useAsteriskInWMI = true, TimeSpan? timeoutInWMI = null) +``` + +The construcotr accepts two settings for WMI: +- `useAsteriskInWMI` causes WMI queries to use `SELECT * FROM` instead of `SELECT` with a list of property names. This is slower, but safer, more compatible with older Windows (XP, Vista, 7, 8) where a certain WMI property might be missing and throw an exception when queried by name. The default value is `true`. +- `timeoutInWMI` sets the `Timeout` property of the `EnumerationOptions` in the `ManagementObjectSearcher` that executes the query. The default value is `EnumerationOptions.InfiniteTimeout`. Changing this could cause the query to return empty results in certain cases. + +### Refresh methods settings: + +``` +RefreshCPUList(bool includePercentProcessorTime = true) + +RefreshNetworkAdapterList(bool includeBytesPersec = true, bool includeNetworkAdapterConfiguration = true) +``` + +In these two methods you can exclude some slow queries by setting the parameters to `false`. + ## Version history: +- 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 `MemAvailable` instead of `MemFree` in Linux - by [@schotime]( https://github.com/schotime ) - 1.0.1.1: