remove disk code

This commit is contained in:
brige.long 2025-08-05 07:21:52 +08:00
parent 88837e3591
commit e39922d4ed

View File

@ -135,24 +135,18 @@ std::string getCpuId() {
return getWMIProperty(L"Win32_Processor", L"ProcessorId");
}
std::string getDiskSerial() {
return getWMIProperty(L"Win32_DiskDrive", L"SerialNumber");
}
std::string getMacAddress() {
return getWMIProperty(L"Win32_NetworkAdapterConfiguration", L"MACAddress");
}
std::string getMachineCode() {
std::string cpuId = getCpuId();
std::string diskSerial = getDiskSerial();
std::string macAddress = getMacAddress();
// Clean up strings
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(macAddress.begin(), macAddress.end(), ':'), macAddress.end());
return cpuId + "-" + diskSerial + "-" + macAddress;
return cpuId + "-" + "-" + macAddress;
}