private int coreCountNum()
{
int coreCount = 0;
foreach (var item in new System.Management.ManagementObjectSearcher("Select NumberOfCores from Win32_Processor").Get())
{
coreCount += int.Parse(item["NumberOfCores"].ToString());
}
return coreCount;
}
private void button1_Click(object sender, EventArgs e)
{
coreCount.Text = Convert.ToString(coreCountNum());
}
This is some of my code which I believe may have an error, if anybody could spot one please let me know. When the button is clicked, it displays the core count on the label but then freezes, thanks.