Retrieve the CPU Type and Speed from the Registry : Registry : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Registry »

 

Retrieve the CPU Type and Speed from the Registry








    


using System;
using Microsoft.Win32;

class Class1 {
    static void Main(string[] args) {
        RegistryKey RegKey = Registry.LocalMachine;
        RegKey = RegKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
        Object cpuSpeed = RegKey.GetValue("~MHz");
        Object cpuType = RegKey.GetValue("VendorIdentifier");
        Console.WriteLine("You have a {0} running at {1} MHz.", cpuType, cpuSpeed);
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Registry