Get classpath of WMI class in c#

 

 

            // Schema query for getting infomation for Win32_LogicalDisk class

            ManagementObjectSearcher q = new ManagementObjectSearcher(@"SELECT * FROM meta_class WHERE __this ISA ""Win32_LogicalDisk""");

 

            // get the each class from the select query.

            foreach (ManagementClass c in q.Get())

            {

 

             // it displays the classpath

                MessageBox.Show(c.ClassPath.ToString());

            }

Ebook Download
View all
FileInfo in C#
Read by 9.7k people
Download Now!
Learn
View all