In this given code M getting "Could not open remote file error" ... i had tried all solution given in this all forums of OPNENETCF but None of this working in my code... plz help me ... thnx in Advance
Imports OpenNETCF.Desktop.Communication.
ublic Class FrmMain
' Declare an instance of the RAPI object.
Dim WithEvents myrapi As New RAPI
Private Sub BtnCheckForConn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCheckForConn.Click
Try
' Connect to the device.
myrapi.Connect()
Do While Not myrapi.DevicePresent
MessageBox.Show("Please connect your device to your PC using ActiveSync and " & _
"before clicking the OK button.", "No Device Present")
Application.Exit()
myrapi.Connect()
Loop
Catch ex As Exception
MessageBox.Show("The following error occurred while attempting to connect to" & _
" your device - " & ex.Message, "Connection Error")
Application.Exit()
End Try
MsgBox("PDA Connected")
End Sub
Private Sub BtnPCtoPDA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPCtoPDA.Click
' Perform the copy.
Try
If (txtCopySource.Text = "") Or (txtCopyDestination.Text = "") Then
MessageBox.Show("You must provide both a source and destination file.", _
"Missing File Information")
Exit Sub
End If
myrapi.CopyFileToDevice(txtCopySource.Text, txtCopyDestination.Text)
MessageBox.Show("Your file has been copied.", "Copy Success")
' Handle any errors that might occur.
Catch ex As Exception
MessageBox.Show("The following error occurred copying the file -" & ex.Message, _
"Copy Error")
End Try
End Sub
Private Sub BtnPDAtoPC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPDAtoPC.Click
Try
If (txtCopySource.Text = "") Or (txtCopyDestination.Text = "") Then
MessageBox.Show("You must provide both a source and destination file.", _
"Missing File Information")
Exit Sub
End If
'myrapi.CopyFileFromDevice(txtCopySource.Text, txtCopyDestination.Text)
myrapi.CopyFileFromDevice("C:\PDA\e.doc", "\My Documents\e.doc", True)
MessageBox.Show("Your file has been copied.", "Copy Success")
' Handle any errors that might occur.
Catch ex As Exception
MessageBox.Show("The following error occurred copying the file -" & ex.Message, _
"Copy Error")
End Try
End Sub
Private Sub BtnMoevFrmPCtoPDA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnMoevFrmPCtoPDA.Click
' Perform the copy.
Try
If (txtCopySource.Text = "") Or (txtCopyDestination.Text = "") Then
MessageBox.Show("You must provide both a source and destination file.", _
"Missing File Information")
Exit Sub
End If
myrapi.MoveDeviceFile(txtCopySource.Text, txtCopyDestination.Text)
MessageBox.Show("Your file has been copied.", "Copy Success")
' Handle any errors that might occur.
Catch ex As Exception
MessageBox.Show("The following error occurred copying the file -" & ex.Message, _
"Copy Error")
End Try
End Sub
Private Sub BtnMoevFrmPDAtoPC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnMoevFrmPDAtoPC.Click
Try
If (txtCopySource.Text = "") Or (txtCopyDestination.Text = "") Then
MessageBox.Show("You must provide both a source and destination file.", _
"Missing File Information")
Exit Sub
End If
myrapi.MoveDeviceFile(txtCopySource.Text, txtCopyDestination.Text)
MessageBox.Show("Your file has been copied.", "Copy Success")
' Handle any errors that might occur.
Catch ex As Exception
MessageBox.Show("The following error occurred copying the file -" & ex.Message, _
"Copy Error")
End Try
End Sub
End Class