7

How to get hardware information (for example cpuId, biosId, diskId, baseId and videoId) in c++?

Can anyone give me an example visual studio project for this?

Omnifarious
56.4k20 gold badges142 silver badges203 bronze badges
asked Nov 23, 2010 at 5:48
3
  • 3
    What platform? What API? Commented Nov 23, 2010 at 5:50
  • 5
    There is no way to do it in standard C++. It has to be done in a platform specific way, so you need to specify which OS you're using. Commented Nov 23, 2010 at 5:50
  • My platform in windows xp and windows 2003 server Commented Nov 23, 2010 at 5:57

3 Answers 3

5

There are very different ways to get a disk id (serial number? volume id?) or a CPU ID or ... . I think you want to build a fingerprint of the computer. The most comfortable way is to use Windows Management Instrumentation (WMI) and access the DMI . See MSDN for a start. See MSDN here for a hint how to get the mainboard serial number as an example.

answered Nov 23, 2010 at 7:02
Sign up to request clarification or add additional context in comments.

Comments

3

GetSystemInfo will get you started with the CPU information. Each subsystem generally has different query functions.

answered Nov 23, 2010 at 7:01

Comments

0

The standard c++ don`t provide this for you. These api may be provided by os or hardware driver.

answered Nov 23, 2010 at 5:56

2 Comments

My platform in wondows xp and windows server 2003 X86.Can i get hardware info in this platforms?
Example: xp: you can get information about disk. There are many apis: GetDiskFreeSpace GetVolumeInfomation

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.