Reputation: 945
the following code doesnot shows the version information correctly.
ManagementObjectSearcher mos = new ManagementObjectSearcher(new SelectQuery("Win32_Processor"));
ManagementObjectCollection moc = mos.Get();
foreach (ManagementObject mo in moc)
{
Console.WriteLine("Version: " +mo["Version"].ToString());
}
it displays blank screen.
am using windows 7 version...
how to resolve it......?
Upvotes: 1
Views: 54
Reputation: 1532
May this can help you:
// Enumerate the Win32_Processor class
EnumerationOptions opt = new EnumerationOptions();
ManagementClass c = new ManagementClass("Win32_Processor");
foreach (ManagementObject o in c.GetInstances(opt))
{
foreach (var item in o.Properties)
{
Console.WriteLine(item.Name + " " + item.Value);
}
}
Upvotes: 1