Surfing the web i read that with this code:
I would have to find the SERIAL NUMBER of the CPU, and so a UNIQUE number. But this is NOT true. Running this simple code on 5 PCs in my office, I have found 3 same IDs on PSc with same processor.
So this is NOT the serial number, but the type of CPU.
Some idea of how to extract a REALLY unique number from a PC?
Ty :)
Code:
Public Function GetProcessorID() As String
Dim sProcessorID As String = ""
Dim sQuery As String = "SELECT ProcessorId FROM Win32_Processor"
Dim oManagementObjectSearcher As ManagementObjectSearcher = Nothing
Try
oManagementObjectSearcher = New ManagementObjectSearcher(sQuery)
Dim oCollection As ManagementObjectCollection = oManagementObjectSearcher.[Get]()
For Each oManagementObject As ManagementObject In oCollection
sProcessorID = DirectCast(oManagementObject("ProcessorId"), String)
Next
oCollection.Dispose()
Return (sProcessorID)
Catch ex As Exception
Debug.Print("GetProcessorError: " & ex.ToString)
Finally
sProcessorID = Nothing
sQuery = Nothing
If Not oManagementObjectSearcher Is Nothing Then oManagementObjectSearcher.Dispose()
End Try
End FunctionSo this is NOT the serial number, but the type of CPU.
Some idea of how to extract a REALLY unique number from a PC?
Ty :)