Retrieve the CPU Type and Speed from the Registry

Bageshkumarbagi
Posted by Bageshkumarbagi under C# category on | Points: 40 | Views : 717
private void button1_Click(object sender, EventArgs e)
{
RegistryKey RegKey = Registry.LocalMachine;
RegKey = RegKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
Object cpuSpeed = RegKey.GetValue("~MHz");
Object cpuType = RegKey.GetValue("VendorIdentifier");
MessageBox.Show("You have a "+ cpuType +" running at "+ cpuSpeed +" MHz.");

}

Comments or Responses

Login to post response