iSMBIOS 1.1.3
See the version list below for details.
dotnet add package iSMBIOS --version 1.1.3
NuGet\Install-Package iSMBIOS -Version 1.1.3
<PackageReference Include="iSMBIOS" Version="1.1.3" />
paket add iSMBIOS --version 1.1.3
#r "nuget: iSMBIOS, 1.1.3"
// Install iSMBIOS as a Cake Addin #addin nuget:?package=iSMBIOS&version=1.1.3 // Install iSMBIOS as a Cake Tool #tool nuget:?package=iSMBIOS&version=1.1.3
What is iSMBIOS?
iSMBIOS is a lightweight implementation that allows us to obtain the SMBIOS information
This library implements DMTF Specification 3.4.0a (Preliminary version) and olders versions
For more information, please see https://www.dmtf.org/standards/smbios
Usage
Call DMI.Instance.Structures for gets all SMBIOS structures availables.
Examples
Gets and prints SMBIOS version.
Console.WriteLine($@" SMBIOS Version > {DMI.Instance.SmbiosVersion}");
Gets and prints all SMBIOS availables structures.
DmiStructureCollection structures = DMI.Instance.Structures; foreach (DmiStructure structure in structures) { Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName}"); int totalStructures = structure.Elements.Count; if (totalStructures > 1) { Console.WriteLine($@" > {totalStructures} structures"); } }
Gets and prints the implemented SMBIOS structure version.
DmiStructureCollection structures = DMI.Instance.Structures; foreach (DmiStructure structure in structures) { Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName}"); DmiClassCollection elements = structure.Elements; foreach (DmiClass element in elements) { Console.WriteLine($@" > Version > {element.ImplementedVersion}"); } }
Gets a specific SMBIOS structure.
DmiStructureCollection structures = DMI.Instance.Structures; DmiStructure bios = structures[SmbiosStructure.Bios]; if (bios != null) { /// structure exist!!! }
Gets a single property directly.
DmiStructureCollection structures = DMI.Instance.Structures; object biosVersion = structures.GetProperty(DmiProperty.Bios.BiosVersion); if (biosVersion != null) { Console.WriteLine($@" BIOS Version > {biosVersion}"); } string biosVendor = structures.GetProperty<string>(DmiProperty.Bios.Vendor); Console.WriteLine($@" > BIOS Vendor > {biosVendor}");
Prints all SMBIOS structures properties
DmiStructureCollection structures = DMI.Instance.Structures; foreach (DmiStructure structure in structures) { DmiClassCollection elements = structure.Elements; foreach (DmiClass element in elements) { Console.WriteLine(); Console.WriteLine(element.ImplementedVersion == DmiStructureVersion.Latest ? $@" ———————————————————————————————————————————————————— {element.ImplementedVersion} ——" : $@" ——————————————————————————————————————————————————————— {element.ImplementedVersion} ——"); Console.WriteLine($@" {(int)structure.Class:D3}-{structure.FriendlyClassName} structure detail"); Console.WriteLine(@" ——————————————————————————————————————————————————————————————"); DmiClassPropertiesTable elementProperties = element.Properties; foreach (KeyValuePair<IPropertyKey, object> property in elementProperties) { object value = property.Value; IPropertyKey key = property.Key; string friendlyName = GetFriendlyName(key); PropertyUnit valueUnit = key.PropertyUnit; string unit = valueUnit == PropertyUnit.None ? string.Empty : valueUnit.ToString(); if (value == null) { Console.WriteLine($@" > {friendlyName} > NULL"); continue; } if (value is string) { Console.WriteLine($@" > {friendlyName} > {value} {unit}"); } else if (value is byte) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X2}h]"); } else if (value is short) { Console.WriteLine(key.Equals(DmiProperty.MemoryDevice.ConfiguredMemoryClockSpeed) } else if (value is ushort) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]"); ? $@" > {friendlyName} > {value} {(int.Parse(DMI.Instance.SmbiosVersion) > 300 ? PropertyUnit.MTs : PropertyUnit.MHz)} [{value:X4}h]" : $@" > {friendlyName} > {value} {unit} [{value:X4}h]"); } else if (value is int) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]"); } else if (value is uint) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X4}h]"); } else if (value is long) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X8}h]"); } else if (value is ulong) { Console.WriteLine($@" > {friendlyName} > {value} {unit} [{value:X8}h]"); } else if (value.GetType() == typeof(ReadOnlyCollection<byte>)) { Console.WriteLine($@" > {friendlyName} > {string.Join(", ", (ReadOnlyCollection<byte>)value)}"); } else if (value.GetType() == typeof(DmiGroupAssociationElementCollection)) { // prints elements } else if (value.GetType() == typeof(ReadOnlyCollection<string>)) { Console.WriteLine($@" > {friendlyName}"); var collection = (ReadOnlyCollection<string>)value; foreach (var entry in collection) { Console.WriteLine($@" > {entry} {unit}"); } } else { Console.WriteLine($@" > {friendlyName} > {value} {unit}"); } } } } private static string GetFriendlyName(IPropertyKey value) { string name = value.GetPropertyName(); return string.IsNullOrEmpty(name) ? value.PropertyId.ToString() : name; }
Changes
For more information, please visit the next link CHANGELOG
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 2.0
- System.Management (>= 4.5.0)
-
.NETCoreApp 2.1
- System.Management (>= 4.5.0)
-
.NETFramework 4.5
- No dependencies.
-
.NETStandard 2.0
- System.Management (>= 4.5.0)
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 |
---|---|---|
1.1.8 | 3,797 | 8/17/2023 |
1.1.7 | 4,111 | 9/29/2022 |
1.1.6 | 3,350 | 12/9/2021 |
1.1.5 | 4,570 | 10/12/2020 |
1.1.4 | 1,287 | 8/25/2020 |
1.1.3 | 2,677 | 3/6/2020 |
1.1.2 | 560 | 2/15/2020 |
1.1.1 | 3,292 | 10/20/2019 |
1.1.0 | 594 | 9/2/2019 |
1.0.9 | 541 | 8/28/2019 |
1.0.8 | 567 | 8/23/2019 |
1.0.7 | 570 | 8/13/2019 |
1.0.6 | 626 | 5/29/2019 |
1.0.5 | 637 | 4/25/2019 |
1.0.3 | 582 | 4/12/2019 |
1.0.2 | 561 | 4/2/2019 |
1.0.1 | 634 | 3/22/2019 |
1.0.0 | 1,321 | 12/29/2018 |