UtilWMIGetAllValuesInWMIClassName Method
Returns a
DictionaryTKey, TValue
that represents all the property and values in the specified WIM class name.
Note that all the values are converted to string.
Namespace: DevCase.Core.Diagnostics.WMIAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static Dictionary<string, Dictionary<string, KeyValuePair<string, string>>> GetAllValuesInWMIClassName(
string classname,
bool includeReferenceProperties,
bool includeNulValues
)
Public Shared Function GetAllValuesInWMIClassName (
classname As String,
includeReferenceProperties As Boolean,
includeNulValues As Boolean
) As Dictionary(Of String, Dictionary(Of String, KeyValuePair(Of String, String)))
Dim classname As String
Dim includeReferenceProperties As Boolean
Dim includeNulValues As Boolean
Dim returnValue As Dictionary(Of String, Dictionary(Of String, KeyValuePair(Of String, String)))
returnValue = UtilWMI.GetAllValuesInWMIClassName(classname,
includeReferenceProperties, includeNulValues)
public:
static Dictionary<String^, Dictionary<String^, KeyValuePair<String^, String^>>^>^ GetAllValuesInWMIClassName(
String^ classname,
bool includeReferenceProperties,
bool includeNulValues
)
static member GetAllValuesInWMIClassName :
classname : string *
includeReferenceProperties : bool *
includeNulValues : bool -> Dictionary<string, Dictionary<string, KeyValuePair<string, string>>>
No code example is currently available or this language may not be supported.
- classname String
-
The WMI class name where to fetch its properties.
- includeReferenceProperties Boolean
- to include reference properties.
- includeNulValues Boolean
- to include values that are nul.
DictionaryString,
DictionaryString,
KeyValuePairString,
String
A
DictionaryTKey, TValue
that represents all the property and values in the specified WIM class name.
This is a code example.
No code example is currently available or this language may not be supported.
Dim classNames As String() = {
"Win32_BaseBoard",
"Win32_BIOS",
"Win32_BootConfiguration",
"Win32_ComputerSystem",
"Win32_ComputerSystemProcessor",
"Win32_ComputerSystemProduct",
"Win32_DiskDrive",
"Win32_DiskPartition",
"Win32_MotherboardDevice",
"Win32_OperatingSystem",
"Win32_PhysicalMedia",
"Win32_PhysicalMemory",
"Win32_Processor",
"Win32_Registry",
"Win32_SystemOperatingSystem"
}
For Each className As String In classNames
Console.WriteLine($"{className}")
Console.WriteLine($"{New String("-"c, className.Length)}")
Dim pathDict As Dictionary(Of String, Dictionary(Of String, KeyValuePair(Of String, String))) =
GetAllValuesInWMIClassName(className, includeReferenceProperties:=True, includeNulValues:=True)
For Each path As KeyValuePair(Of String, Dictionary(Of String, KeyValuePair(Of String, String))) In pathDict
Console.WriteLine()
Console.WriteLine($"{path.Key}")
Console.WriteLine($"{New String("-"c, path.Key.Length)}")
Console.WriteLine()
Dim longestPropertyName = (From pdName As String In path.Value.Keys).
OrderByDescending(Function(name As String) name.Length).
FirstOrDefault()?.Length
For Each prop As KeyValuePair(Of String, KeyValuePair(Of String, String)) In path.Value
Console.WriteLine($"{{0,-10}} {{1,-{longestPropertyName}}}: {{2}}", prop.Value.Key, prop.Key, prop.Value.Value)
Next prop
Next path
Console.WriteLine()
Next className
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.