Public Function createID() As String
Dim regPID As RegistryKey
Dim regGUID As RegistryKey
regPID = Registry.LocalMachine.OpenSubKey("hardware\description\system\bios", False)
regGUID = Registry.LocalMachine.OpenSubKey("hardware\description\system\bios", False)
Dim Pid As Object = Replace(regPID.GetValueKind("SystemFamily"), "-", "")
Dim GUID As Object = Replace(regGUID.GetValue("BaseBoardManufacturer"), "-", "")
DmilenPID As Integer
'Number of characters in ProductId.
lenPID = Len(Pid)
Dim lenGUID As Integer
'Number of characters in MachineGUID.
lenGUID = Len(GUID)
Dim tempValue As String
Dim strPID As String
Dim strGUID As String
Dim hardwareID As String
'Continues conversion to the end of the string length.
For x = 1 To lenPID
tempValue = Hex((Asc(Mid(Pid, x, 1)) Xor 23) Xor 14)
'Puts the ProductId and Xor'd Values together.
'ProductId first, then Xor'd Values come after.
'Note: This makes the ID longer.
strPID = strPID & tempValue
Next x
'Reverses the character/string order of ProductId.
strPID = StrReverse(strPID)
'Continues conversion to the end of the string length.
For x = 1 To lenGUID
tempValue = Hex((Asc(Mid(GUID, x, 1)) Xor 23) Xor 14)
'Puts the MachineGUID and Xor'd Values together.
'MachineGUID first, then Xor'd values come after.
'Note: This makes the ID longer.
strGUID = strGUID & tempValue
Next x
'Reverses the character/string order of MachineGUID.
strGUID = StrReverse(strGUID)
'Reverses MachineGUID back first, then adds the reversed
'character/string order of ProductId.
hardwareID = StrReverse(strGUID & strPID)
createID = hardwareID
End Function