Get Computer Info

  • Thread starter Thread starter kennethj
  • Start date Start date
K

kennethj

PlI would like to get the processor info, like what shows up in the system
properties from WinXP. For instance mine says Pentium(R) D CPU 2.66 GHz. I
would also like to get the computer model. This is in my case a Dell
OptiPlex GX620SD. Any help would be appreciated.
 
Hi Peter,
Sounds like a WMI thing. Unfortunately, I have not found WMI to be
well-documented. But, it's a place to start, anyway.

Well, i personally think, WMI is well documented, including Usermode
and Kernelmode Interfaces as well. And yes, its a WMI thing, at least
for .NET Developers. The Same Stuff can be collected by using Windows
API and undocumented stuff, but there is no need for native and pinvoke
code,...
And it's possible someone else reading this will have some first-hand
knowledge of the correct WMI calls to make to get the information you're
asking about.

Read my reply, links and sample WMI/WQL Queries,...

Regards

Kerem
 
Hi Peter,

read my first post and follow the links
in it,...

I also recommend you to use
the Query Interface in my application
if you want to get fast and clean information,...

Regards

Kerem
 
Peter said:
Can you provide a link?

I have repeatedly gone looking for information on how to make
appropriate WMI queries with .NET code for a variety of things, and
every time have failed to find any documentation that is straightforward
and clear. And I'm generally pretty good at tracking things down on MSDN.

The API is relative simple, so any WMI example should do.

What you need is the description of WMI classes/attributes
to query.

They are online:
http://msdn.microsoft.com/en-us/library/aa394554.aspx

Arne
 
kennethj said:
PlI would like to get the processor info, like what shows up in the system
properties from WinXP. For instance mine says Pentium(R) D CPU 2.66 GHz.

Example:

using System;
using System.Management;

public class MainClass
{
public static void Main(string[] args)
{
ObjectQuery wmicpus = new WqlObjectQuery("SELECT * FROM
Win32_Processor");
ManagementObjectSearcher cpus = new
ManagementObjectSearcher(wmicpus);
foreach (ManagementObject cpu in cpus.Get())
{
Console.WriteLine(cpu["DeviceId"] + " : " + cpu["Name"]);
}
}
}
I
would also like to get the computer model. This is in my case a Dell
OptiPlex GX620SD. Any help would be appreciated.

I don't know if you can get that info.

You should be able to get information about motherboard.

Arne
 
Thanks for the help. The interface is very helpful to see all the fields
returned. I had tried WMI but the field returned was garbage to me. I had
processorID which is not helpful at all. Is there similar code for 64-bit
chips, I have some users that run machines with that.
 
Hi Keneth,

if you talk about my software, no , its 32-bit only
at first, in the middle of march there will be a 64-bit
version available,...

If you talk about WMI, yes, it works the same on
32bit as it does on 64bit,...the classes and the code
are the same, as long as you work with pure
DotNET Classes and the Framework,...

Regards

Kerem
 
Back
Top