tags:

views:

309

answers:

2

I need my code to behave differently dependent on the chipset of the computer it is running on. How can I determine this using C#.

Specifically Intel 945 vs 965.

A: 

You could the system's environment variable:

System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
Steve Danner
I think you accidentally a word.
Foole
No, that doesn't do it. It only returns the architecture of the CPU. I want the motherboard chipset.
rathkopf
A: 

If you can get that information, you can surely get it through WMI. Here's a tool that'll autogenerate the C# code for you to do any WMI query:

WMI Code Creator v1.0

(By default it generates VBScript; change the Code Language setting to get C# or VB .NET. You can select multiple properties in the "Select the properties you want values for:" window.)

Unfortunately, I have no idea which of the gazillions of possible WMI queries you'd execute to find out the chipset, and searching only came up with pages asserting that it can't be done for motherboard chipset specifically.

But maybe you'll find the WMI Code Creator useful for other things at any rate.

Kyralessa
Thanks for the link. Now if only someone would post the proper calls. I figured that WMI was going to be the way to go, but I couldn't find the proper queries when I googled with bing.
rathkopf