DeviceID: Not working anymore on WM 6?!


James Caan


I use the following code for generating a deviceID:
It did work on every WM 5 Device (PocketPC and Smartphone)
But it does not work anymore on a WM 6 Device?

Private Function GetDeviceID() As String
Dim deviceid As String = ""
Dim DeviceIDinByte() As Byte = GetDeviceID("X3fggh23HHJlökj3ghe23ghbljk23")
For i As Integer = 0 To DeviceIDinByte.Length - 1
deviceid = deviceid & DeviceIDinByte(i)
End Try
Return deviceid
End Function
<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 Integer
End Function
Public Function GetDeviceId(ByVal appData As String) As Byte()
Dim appDataBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(appData)
Dim outputSize As Integer = 20
Dim output(19) As Byte
Dim result As Integer = GetDeviceUniqueID(appDataBytes, appDataBytes.Length,
1, output, outputSize)
Return output
End Function


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question