An EnumerationOptions variable with an EnumerationOptions constructor and then gets all the instances of a WMI class and its subclasses. : Management « Windows « C# / CSharp Tutorial






using System;
using System.Management;
public class RemoteConnect 
{
    public static void Main() 
    {
        EnumerationOptions opt = new EnumerationOptions(
            null, System.TimeSpan.MaxValue,
            1, true, true, false, 
            true, false, false, true);

        ManagementClass c = new ManagementClass("CIM_Service");
        foreach (ManagementObject o in c.GetInstances(opt))
            Console.WriteLine(o["Name"]);
    }
}








29.18.Management
29.18.1.Get ManagementObjectCollection
29.18.2.An EnumerationOptions variable with an EnumerationOptions constructor and then gets all the instances of a WMI class and its subclasses.
29.18.3.Connect to a remote computer and displays information about the operating system