Initialize a ManagementClass and Get the Qualifiers in the class : ManagementClass « Windows « C# / C Sharp






Initialize a ManagementClass and Get the Qualifiers in the class

  


using System;
using System.Management;

public class Sample 
{    
    public static void Main() 
    {

        // Get the WMI class
        ManagementClass c = new ManagementClass("Win32_LogicalDisk");

        // Get the methods in the class
        MethodDataCollection methods = c.Methods;

        // Get the Qualifiers in the class
        QualifierDataCollection qualifiers = c.Qualifiers;

        // display the qualifiers
        Console.WriteLine("Qualifier Names: ");
        foreach (QualifierData qualifier in qualifiers)
        {
            Console.WriteLine(qualifier.Name);
        }
    }
}

   
    
  








Related examples in the same category

1.Enumerate ManagementClass
2.Initialize a ManagementClass and list its methods
3.Initialize a ManagementClass and Get the properties in the class
4.Create ManagementObjectSearcher to query Win32_Service