Hello

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 = ""
Try
Dim DeviceIDinByte() As Byte = GetDeviceID("X3fggh23HHJlökj3ghe23ghbljk23")
For i As Integer = 0 To DeviceIDinByte.Length - 1
deviceid = deviceid & DeviceIDinByte(i)
Next
Catch
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

Re: DeviceID: Not working anymore on WM 6?! by James

James
Sat May 19 19:57:02 CDT 2007

My Error *ashamed* :-)

"James Caan" <james @ caan.be> schrieb im Newsbeitrag
news:%23uuD1YnmHHA.4188@TK2MSFTNGP02.phx.gbl...
> Hello
>
> 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 = ""
> Try
> Dim DeviceIDinByte() As Byte =
> GetDeviceID("X3fggh23HHJlökj3ghe23ghbljk23")
> For i As Integer = 0 To DeviceIDinByte.Length - 1
> deviceid = deviceid & DeviceIDinByte(i)
> Next
> Catch
> 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
>
>