读书人

求救!通过RAPI从设备复制文件到PC有

发布时间: 2012-01-15 22:57:49 作者: rapoo

求救!通过RAPI从设备复制文件到PC,有知道的吗?
’工程引用了“OpenNETCF.Desktop.Communication.dll”
Imports OpenNETCF.Desktop.Communication

Public Class Form1

Private Sub btnCopyFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopyFile.Click

Dim myrapi As New RAPI
Dim strSource As String = "\My Documents\in.txt" 'PocketPc 这个文件通过ActiveSync能浏览到
Dim strDestination As String = "E:\in.txt" 'Pc 本机文件

Try

' 连接到设备。
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")
' myrapi.Connect()
'Loop

'从设备复制到计算机
myrapi.CopyFileFromDevice(strSource, strDestination, True)'这步报错:Could not open remote file

'从计算机复制到设备
'myrapi.CopyFileToDevice(strDestination, strSource)

Catch ex As Exception
MessageBox.Show(ex.Message.ToString)
Application.Exit()
End Try

End Sub

End Class


有知道的高手指导下吗,不胜感激!

[解决办法]
那只好接分了,给你一个RAPI的例子
http://hi.baidu.com/fenglingtoqq/blog/item/0063f8d3649b6f3f960a1669.html
[解决办法]
CopyFileFromDevices 查一下msdn看看用法

读书人网 >Windows Mobile

热点推荐