HolaJan
HolaJan

Reputation: 916

How to get processor code name

I want to get processor code name (eg. "Ivy Bridge", "Sandy Bridge") like CPU-Z tool on Windows but from C# code.

Upvotes: 1

Views: 1253

Answers (1)

Aliostad
Aliostad

Reputation: 81660

Use PROCESSOR_IDENTIFIER environment variable:

var cpuId = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER");

In my case it prints:

// Intel64 Family 6 Model 69 Stepping 1, GenuineIntel

WMI is also another method to get to the same information but this one is simpler.

Bear in mind, you may never be able to get the exact string CPU-Z provides since it is very likely it has a mapping table that reads this environment variable and internally maps to the code name and outputs.

Upvotes: 1

Related Questions