Skip to content

Commit

Permalink
Version 1.1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinjinov committed Aug 23, 2021
1 parent 9af7b00 commit 10d2008
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Hardware.Info/Hardware.Info.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PropertyGroup>
<PackageId>Hardware.Info</PackageId>
<Product>Hardware.Info</Product>
<Version>1.1.0.0</Version>
<Version>1.1.0.1</Version>
<Authors>Jinjinov</Authors>
<Description>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.</Description>
<PackageTags>Computer;Device;Hardware;Info;Information;NET Standard;Windows;Linux;macOS</PackageTags>
Expand Down
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<PackageReference Include="Hardware.Info" Version="1.1.0.0" />
<PackageReference Include="Hardware.Info" Version="1.1.0.1" />

2. Call `RefreshAll()` or one of the other `Refresh*()` methods:

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 10d2008

Please sign in to comment.