ManagementPath path = new("root\\cimv2:Win32_Process"); Console.WriteLine("Namespace: " + path.NamespacePath); Console.WriteLine("Class Name: " + path.ClassName);
ManagementPath path = new("root\\cimv2:Win32_Service.Name='Spooler'"); Console.WriteLine("Namespace: " + path.NamespacePath); Console.WriteLine("Class Name: " + path.ClassName); Console.WriteLine("Key Name: " + path.KeyName); Console.WriteLine("Key Value: " + path.KeyValue);This code creates a new ManagementPath object and initializes it with a WMI object class Win32_Service and key values necessary to identify a specific service object with the name of 'Spooler'. It then prints out its Namespace path, class name, key name and key value. Package library: System.Management.