remove disk code
This commit is contained in:
parent
88837e3591
commit
e39922d4ed
@ -135,24 +135,18 @@ std::string getCpuId() {
|
|||||||
return getWMIProperty(L"Win32_Processor", L"ProcessorId");
|
return getWMIProperty(L"Win32_Processor", L"ProcessorId");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getDiskSerial() {
|
|
||||||
return getWMIProperty(L"Win32_DiskDrive", L"SerialNumber");
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string getMacAddress() {
|
std::string getMacAddress() {
|
||||||
return getWMIProperty(L"Win32_NetworkAdapterConfiguration", L"MACAddress");
|
return getWMIProperty(L"Win32_NetworkAdapterConfiguration", L"MACAddress");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getMachineCode() {
|
std::string getMachineCode() {
|
||||||
std::string cpuId = getCpuId();
|
std::string cpuId = getCpuId();
|
||||||
std::string diskSerial = getDiskSerial();
|
|
||||||
std::string macAddress = getMacAddress();
|
std::string macAddress = getMacAddress();
|
||||||
|
|
||||||
// Clean up strings
|
// Clean up strings
|
||||||
cpuId.erase(std::remove_if(cpuId.begin(), cpuId.end(), isspace), cpuId.end());
|
cpuId.erase(std::remove_if(cpuId.begin(), cpuId.end(), isspace), cpuId.end());
|
||||||
diskSerial.erase(std::remove_if(diskSerial.begin(), diskSerial.end(), isspace), diskSerial.end());
|
|
||||||
macAddress.erase(std::remove_if(macAddress.begin(), macAddress.end(), isspace), macAddress.end());
|
macAddress.erase(std::remove_if(macAddress.begin(), macAddress.end(), isspace), macAddress.end());
|
||||||
macAddress.erase(std::remove(macAddress.begin(), macAddress.end(), ':'), macAddress.end());
|
macAddress.erase(std::remove(macAddress.begin(), macAddress.end(), ':'), macAddress.end());
|
||||||
|
|
||||||
return cpuId + "-" + diskSerial + "-" + macAddress;
|
return cpuId + "-" + "-" + macAddress;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user