Get Property and Method Name of WMI Classes Programmatically in C#
This article shows how you can get property name and method name programmatically instead of writing explicitly.
This article shows how you can get property name and method name
programmatically instead of writing explicitly.
There is one special class called "meta_class" which provides schema
It identifies select query as schema query.
Query look like this:
SELECT * FROM meta_class WHERE __this ISA "Win32_LogicalDisk"
Here, WMI class name declare in double quote in select query.
Code and explanation:
// Schema query for getting infomation for
ManagementObjectSearcher(@"SELECT * FROM
meta_class WHERE __this ISA ""Win32_LogicalDisk""");
// get the each class from the select query.
c in q.Get())
// get the each propery name of WMI
d in c.Properties)
// get the each method name of WMI class
m in c.Methods)
Hope you understand it,