用程序去获取计算机信息!!!!!!!!!!!!!

sorrykick 2009-04-27 11:29:07
加精
可以问一下,怎么用C++来实现获取计算机的CPU型号,显卡的型号,声卡的型号,硬盘的型号,内存的大小和使用情况。
...全文
5511 158 打赏 收藏 转发到动态 举报
写回复
用AI写文章
158 条回复
切换为时间正序
请发表友善的回复…
发表回复
sergery 2011-09-24
  • 打赏
  • 举报
回复
mark......
mhm0902 2011-09-02
  • 打赏
  • 举报
回复
看看,学习。
sssschenyi 2011-06-15
  • 打赏
  • 举报
回复
学习了
大郭姐 2011-04-22
  • 打赏
  • 举报
回复
怎样用C语言调用Windows库函数呢
KevinHo 2011-04-19
  • 打赏
  • 举报
回复
有没有用注册表读取的啊??????
brightwiz 2010-05-24
  • 打赏
  • 举报
回复
学习学习
中国007程序员 2010-05-24
  • 打赏
  • 举报
回复
GetSystemInfo

专程来学习的。。。
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 lingyin55 的回复:]
获取计算机信息有关的API

http://hi.baidu.com/estly/blog/item/bf0cbd34a5d1fcb4d0a2d3fb.html
[/Quote]


收下了,谢谢
bolary 2010-04-25
  • 打赏
  • 举报
回复
哈哈~这样也可以吖~
jh_fan88 2010-04-17
  • 打赏
  • 举报
回复
学习了
icycode 2009-12-02
  • 打赏
  • 举报
回复
void GetSystemInfo(
LPSYSTEM_INFO lpSystemInfo
);

typedef struct _SYSTEM_INFO { union { DWORD dwOemId; struct { WORD wProcessorArchitecture; WORD wReserved; }; }; DWORD dwPageSize; LPVOID lpMinimumApplicationAddress; LPVOID lpMaximumApplicationAddress; DWORD_PTR dwActiveProcessorMask; DWORD dwNumberOfProcessors; DWORD dwProcessorType; DWORD dwAllocationGranularity; WORD wProcessorLevel; WORD wProcessorRevision;
} SYSTEM_INFO;
xladykiller 2009-12-02
  • 打赏
  • 举报
回复
Getting Hardware Information
The following examples get or set hardware information.

Example 1
The following example uses the GetSystemInfo function to obtain hardware information such as the OEM identifier, processor type, page size, and so on. The example displays the information in the console.


#include <windows.h>
#include <stdio.h>

void main()
{
SYSTEM_INFO siSysInfo;

// Copy the hardware information to the SYSTEM_INFO structure.

GetSystemInfo(&siSysInfo);

// Display the contents of the SYSTEM_INFO structure.

printf("Hardware information: \n");
printf(" OEM ID: %u\n", siSysInfo.dwOemId);
printf(" Number of processors: %u\n",
siSysInfo.dwNumberOfProcessors);
printf(" Page size: %u\n", siSysInfo.dwPageSize);
printf(" Processor type: %u\n", siSysInfo.dwProcessorType);
printf(" Minimum application address: %lx\n",
siSysInfo.lpMinimumApplicationAddress);
printf(" Maximum application address: %lx\n",
siSysInfo.lpMaximumApplicationAddress);
printf(" Active processor mask: %u\n",
siSysInfo.dwActiveProcessorMask);
}

Example 2
The following example uses the GetSystemMetrics function to determine whether a mouse is installed and whether the mouse buttons are swapped. The example also uses the SystemParametersInfo function to retrieve the mouse threshold and speed. It displays the information in the console.


#include <windows.h>
#include <stdio.h>

void main()
{
BOOL fResult;
int aMouseInfo[3];

fResult = GetSystemMetrics(SM_MOUSEPRESENT);

if (fResult == 0)
printf("No mouse installed.\n");
else
{
printf("Mouse installed.\n");

// Determine whether the buttons are swapped.

fResult = GetSystemMetrics(SM_SWAPBUTTON);

if (fResult == 0)
printf("Buttons not swapped.\n");
else printf("Buttons swapped.\n");

// Get the mouse speed and the threshold values.

fResult = SystemParametersInfo(
SPI_GETMOUSE, // get mouse information
0, // not used
&aMouseInfo, // holds mouse information
0); // not used

if( fResult )
{
printf("Speed: %d\n", aMouseInfo[2]);
printf("Threshold (x,y): %d,%d\n",
aMouseInfo[0], aMouseInfo[1]);
}
}
}

Example 3
The following example uses SystemParametersInfo to double the mouse speed.


#include <windows.h>
#include <stdio.h>

void main()
{
BOOL fResult;
int aMouseInfo[3]; // array for mouse information

// Get the current mouse speed.

fResult = SystemParametersInfo(
SPI_GETMOUSE, // get mouse information
0, // not used
&aMouseInfo, // holds mouse information
0); // not used

// Double it.

if( fResult )
{
aMouseInfo[2] = 2 * aMouseInfo[2];

// Change the mouse speed to the new value.

SystemParametersInfo(
SPI_SETMOUSE, // set mouse information
0, // not used
aMouseInfo, // mouse information
SPIF_SENDCHANGE); // update win.ini
}
}
lidowx 2009-11-21
  • 打赏
  • 举报
回复
每天十分
tutu08 2009-11-21
  • 打赏
  • 举报
回复
收藏了!
sj13426074890 2009-11-20
  • 打赏
  • 举报
回复
UP
xyxhc 2009-11-20
  • 打赏
  • 举报
回复
留个脚印,别丢了.
clever101 2009-10-31
  • 打赏
  • 举报
回复
收藏一下,有空写个总结的帖子。
unsv29mj 2009-10-19
  • 打赏
  • 举报
回复
太简单了 微软都给现成了 你找找 !!!

VB就能找到!!

至于Vc 你自己找!!!???

难道你还要自己写啊 !!!????
眼睛猥琐男 2009-10-19
  • 打赏
  • 举报
回复
好东西
wcq412 2009-06-28
  • 打赏
  • 举报
回复
不懂,学习一下
加载更多回复(138)

65,210

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧