DWORD dwEAX = 0; DWORD dwEBX = 0; DWORD dwECX = 0; DWORD dwEDX = 0; // 获取CPUID0 _asm { mov eax, 0 cpuid mov dwEAX, eax mov dwEBX, ebx mov dwECX, ecx mov dwEDX, edx } printf("CPUID0: EAX = %p " "EBX = %p " "ECX = %p " "EDX = %p ", dwEAX, dwEBX, dwECX, dwEDX); puts(""); // 获取CPUID1 _asm { mov eax, 1 cpuid mov dwEAX, eax mov dwEBX, ebx mov dwECX, ecx mov dwEDX, edx } printf("CPUID1: EAX = %p " "EBX = %p " "ECX = %p " "EDX = %p ", dwEAX, dwEBX, dwECX, dwEDX); puts(""); // 参数1的结构体 PIP_ADAPTER_INFO tag_AdapterInfo = new IP_ADAPTER_INFO[sizeof(IP_ADAPTER_INFO)]; PIP_ADAPTER_INFO lpTemp = tag_AdapterInfo; // 参数2的大小 ULONG lLen = sizeof(IP_ADAPTER_INFO); GetAdaptersInfo(tag_AdapterInfo, &lLen); GetAdaptersInfo(tag_AdapterInfo, &lLen); // 循环获取机器上的所有网卡信息. while(lpTemp) { printf("MAC: %02x-%02x-%02x-%02x-%02x-%02x ", lpTemp->Address[0], lpTemp->Address[1], lpTemp->Address[2], lpTemp->Address[3], lpTemp->Address[4], lpTemp->Address[5]); lpTemp = lpTemp->Next; } delete[] tag_AdapterInfo; puts(""); /* LONG RegOpenKeyEx( HKEY hKey, // handle to open key LPCTSTR lpSubKey, // subkey name DWORD ulOptions, // reserved REGSAM samDesired, // security access mask PHKEY phkResult // handle to open key ); */ HKEY hKey = NULL; RegOpenKeyEx(HKEY_LOCAL_MACHINE, "HARDWARE\DESCRIPTION\System\", 0, KEY_ALL_ACCESS, &hKey); /* LONG RegQueryValueEx( HKEY hKey, // handle to key LPCTSTR lpValueName, // value name LPDWORD lpReserved, // reserved LPDWORD lpType, // type buffer LPBYTE lpData, // data buffer LPDWORD lpcbData // size of data buffer ); */ DWORD dwType = 0; BYTE szKeyValue[MAXBYTE] = {0}; DWORD dwKeyValueLen = sizeof(szKeyValue); RegQueryValueEx(hKey, "SystemBiosVersion", NULL, &dwType, szKeyValue, &dwKeyValueLen); printf("Bios: %s", szKeyValue); puts(""); system("pause"); return 0;