how to programmically get the UUID of your windows machine in vb.net
you need to add reference system.management:
Dim wmiObj As New System.Management.ManagementObjectSearcher("SELECT UUID FROM Win32_ComputerSystemProduct")
Dim objMgmt As System.Management.ManagementObject
For Each objMgmt In wmiObj.Get
MsgBox(objMgmt("UUID").ToString())
Next
Interesting, but I guess it still correctly gets the UUID, whatever its set to. Wrap a Try around it just incase its not there if it throws an exception.
I have some home built machines and they have UUIDs so the actual use of the UUID needs more research.
Doesn't always work - home-built systems don't have a UUID or it's set to all F's or all 0's.
ReplyDeleteInteresting, but I guess it still correctly gets the UUID, whatever its set to. Wrap a Try around it just incase its not there if it throws an exception.
ReplyDeleteI have some home built machines and they have UUIDs so the actual use of the UUID needs more research.