Hello, when i try to connect my application, not foud a device, my code is :
Dim rapiConn As New RAPI
rapiConn.Connect()
If rapiConn.Connected Then
MessageBox.Show("conectado", "conectado")
Else
MessageBox.Show("desconectado", "desconectado")
End If
Dim remoteFile As String
Dim remotePath As String
Dim localFile As String
Dim localPath As String
Dim archivo As String
remoteFile = "\My Documents\prueba.txt"
localPath = "c:\"
archivo = "prueba.txt"
localFile = localPath & archivo
remotePath = "\My Documents\"
Try
Do While rapiConn.DevicePresent = False
MsgBox("Error connecting, please make sure your device is connected", MsgBoxStyle.Critical, "Device Not Found")
Loop
If rapiConn.DevicePresent Then
If rapiConn.DeviceFileExists(remotePath) Then
rapiConn.DeleteDeviceFile(remoteFile)
rapiConn.CopyFileToDevice(localFile, remoteFile)
ElseIf rapiConn.DeviceFileExists(remotePath) = False Then
rapiConn.CreateDeviceDirectory(remotePath)
rapiConn.CopyFileToDevice(localFile, remoteFile)
Dim size As IntegerDo While rapiConn.Connected
size =
CInt(rapiConn.GetDeviceFileSize(remoteFile))
'ProgressBar1.Value = size
Loop
End If
End IfCatch ex As Exception
MsgBox("The following error occurred while trying to connect to your device: " & ex.Message, MsgBoxStyle.Critical, "Connection Error")
Exit Sub
Finally
rapiConn.Disconnect()
MsgBox("File copied successfully, please wait for data import.", MsgBoxStyle.Information, "Copy Status")
'importFile(remoteFile)
End Try
When debugg, in line : Do While rapiConn.DevicePresent = False always is false, but its recogniza that is conneted.
help me, please.