I need a simple way of checking how much ram and fast the CPU of the host PC is. I tried WMI however the code I’m using
private long getCPU()
{
ManagementClass mObject = new ManagementClass("Win32_Processor");
mObject.Get();
return (long)mObject.Properties["MaxClockSpeed"].Value;
}
Throws a null reference exception. Furthermore, WMI queries are a bit slow and I need to make a few to get all the specs. Is there a better way?
http://dotnet-snippets.com/dns/get-the-cpu-speed-in-mhz-SID575.aspx
RAM can be found in this SO question: How do you get total amount of RAM the computer has?