To complement the C# version posted Here, here is a working VB translation:-
<System.Runtime.InteropServices.DllImport("coredll.dll")> _Private Shared Function GetDeviceUniqueID(ByVal appdata As Byte(), ByVal cbApplictionData As Integer, ByVal dwDeviceIDVersion As Integer, ByVal deviceIDOuput As Byte(), ByRef pcbDeviceIDOutput As Integer) As IntegerEnd FunctionPrivate Function GetDeviceId(ByVal appData As String) As Byte()Dim appDataBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(appData)Dim outputSize As Integer = 20Dim output(19) As ByteDim result As Integer = GetDeviceUniqueID(appDataBytes, appDataBytes.Length, 1, output, outputSize)Return outputEnd Function
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.