First add the reference System.Management from COM tab in your project.
Here is the Example Code:
using System.Management;
ManagementObjectSearcher mo = new ManagementObjectSearcher("select * from Win32_Processor");
foreach (ManagementObject mob in mo.Get())
{
try
{
listBox1.Items.Add(mob["ProcessorId"].ToString());
}
catch (Exception ex)
{
// handle exception
}
}
Leave a Reply
Guest User
Not sure what course is right for you?
Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.
PARTH
First add the reference System.Management from COM tab in your project.
Here is the Example Code:
using System.Management;
ManagementObjectSearcher mo = new ManagementObjectSearcher("select * from Win32_Processor");
foreach (ManagementObject mob in mo.Get())
{
try
{
listBox1.Items.Add(mob["ProcessorId"].ToString());
}
catch (Exception ex)
{
// handle exception
}
}