Home > Software engineering >  Consult, MFC how to access the hardware information, including CPU, hard disk, network CARDS, etc.
Consult, MFC how to access the hardware information, including CPU, hard disk, network CARDS, etc.

Time:09-24

Consult, MFC how to access the hardware information, including CPU, hard disk, network CARDS, etc., thank you!

CodePudding user response:

1. The wmi

2. CMD systeminfo

 output similar to the 
The OS name: Microsoft Windows XP Professional
OS version: 5.1.2600 Service Pack 3 Build 2600
OS maker: Microsoft Corporation
OS configuration: independent workstation
OS component types: Multiprocessor Free
To register all of the people: Microsoft user
Registration organization: Microsoft
Product ID: 71481-610-8134005-21407
Initial installation date: 2011-01-02, 21:50:55
System startup time: 1 hour three days 11 minutes and 8 seconds
System manufacturer: BIOSTAR Group
System models: H61MHB
System type: X86 - -based PC
Processor: installed one processor,
[01] : x86 Family 6 58 Stepping Model 9 GenuineIntel ~ 2594 Mhz
The BIOS version: ALASKA - 1072009
Windows directory: C: \ Windows
The system directory: C: \ WINDOWS \ system32

CodePudding user response:

Is the question about which API function

CodePudding user response:

Advise the landlord don't spend and waste your limited life infinite encryption to decrypt dead loop!

CodePudding user response:

Could be obtained by WMI ~ ~

CodePudding user response:

Want to know, under the win10, how to obtain the SSD ID?

CodePudding user response:

Baidu search relevant keywords,

CodePudding user response:

Consult smwhotjay: can you say detailed point, thank you!

CodePudding user response:

 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* the Function Name: GetLocalMac
* Function: to obtain the native MAC address
* Input Parameters: NULL
* the OutPut Parameters: NULL
* the Return Value: the MAC address
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Cstrings CFlyCheckImageApp: : GetLocalMac ()
{
Cstrings strMacTemp;

ULONG ulOutBufLen=sizeof (IP_ADAPTER_INFO);
PIP_ADAPTER_INFO pAdapterInfo=(IP_ADAPTER_INFO *) malloc (sizeof (IP_ADAPTER_INFO));
If (pAdapterInfo==NULL)
return NULL;
If (GetAdaptersInfo (pAdapterInfo, & amp; UlOutBufLen)==ERROR_BUFFER_OVERFLOW)
{
Free (pAdapterInfo);
PAdapterInfo=(IP_ADAPTER_INFO *) malloc (ulOutBufLen);
If (pAdapterInfo==NULL)
return NULL;
}

If (GetAdaptersInfo (pAdapterInfo, & amp; UlOutBufLen)==NO_ERROR)
{
For (PIP_ADAPTER_INFO pAdapter=pAdapterInfo; PAdapter!=NULL; PAdapter=pAdapter - & gt; Next)
{
//make sure is the physical adapter cable
If (pAdapter - & gt; The Type!=MIB_IF_TYPE_ETHERNET | | pAdapter - & gt; Type==71 | | STRSTR (pAdapter - & gt; The Description, "Bluetooth") & gt; 0)
continue;
If (pAdapter - & gt; AddressLength!
=6)continue;
StrMacTemp. Format (" % % % 02 x: 02 x: 02 x: x % 02:02: x % % 02 x ",
Int (pAdapter - & gt; Address [0]),
Int (pAdapter - & gt; Address [1]),
Int (pAdapter - & gt; Address [2]),
Int (pAdapter - & gt; Address [3]),
Int (pAdapter - & gt; Address [4]),
Int (pAdapter - & gt; Address [5]));
break;
}
}
Free (pAdapterInfo);

Return strMacTemp;
}

CodePudding user response:

 char vendor_serialnumber [0 x14]={0}; 
Char * SoftAuther: : GetCpuID ()
{
STD: : array__cpuid (cpui. Data (), 0 x0);
Int nIds_=cpui [0];
STD: : vector Data_;//save traverse to the values of all the cpui
for (int i=0; i<=nIds_; + + I)
{
__cpuidex (cpui. Data (), I, 0).
Data_. Push_back (cpui);
}
//reinterpret_cast & lt; Int * & gt; (vendor)//* reinterpret_cast & lt; Int * & gt; (vendor)
//the value of the index 0 0 + 4 0 + 8 constitutes the CPU chip, the name of the
Char vendor [0 x20]={0};
* reinterpret_cast & lt; Int * & gt; (vendor)=data_ [0] [1].
* reinterpret_cast & lt; Int * & gt; (vendor + 4)=data_ [0] [3].
* reinterpret_cast & lt; Int * & gt; (vendor + 8)=data_ [0] [2].
STD: : string vendor_=vendor;
Sprintf_s (vendor_serialnumber, sizeof (vendor_serialnumber), "% x" 08, data_ [1] [0]).
Return vendor_serialnumber;
}

Access to cpuid

CodePudding user response:

Do you want these I've just finished, feel useful can see
 https://blog.csdn.net/github_37567324 

CodePudding user response:

Do you want these I've just finished, feel useful can take a look at https://blog.csdn.net/github_37567324