Ver Mensaje Individual
  #3  
Antiguo 04-01-2010
JordiP JordiP is offline
Miembro
 
Registrado: nov 2009
Posts: 48
Reputación: 0
JordiP Va por buen camino
Gracias white_zombie, he aplicado el ejemplo que aparece en el enlace y no logro saber cual es el valor que necesito, en este caso el ID de mi dispositivo PDA.

Código:
<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
 
Private Function GetDeviceIdUnique(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
Hasta aqui llego pero no se que variable es la que me devuelve el ID, teoricamente es "outPut", que viene en Bytes, intento convertirlos a String y lo que veo son todos ceros "000000....."

Código:
 
Dim sb As New StringBuilder
Dim i As Integer
 
For i = 0 To outputSize - 1
  sb.Append(String.Format("{0:X2}", output(i)))
Next i
 
MsgBox("Result: " + sb.ToString)
Espero que alguien pueda ayudarme.

Saludos



Responder Con Cita