I\'m trying to write some WMI in my windows form and the ManagementObject is givin me the
\"The type or namespace name \'ManagementObject\' could not be found\" Err
I think the problem is there is no WMI object for Win32_LogicalDisk.DeviceID=\"C:\"
.
Try to replace:
ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"");
with:
ManagementObject disk = new ManagementObject("Win32_LogicalDisk");
and then to step through each field:
foreach (ManagementObject o in disk.Get()){
//Do what ever you need here.... For example:
Console.WriteLine(o.ToString());
}