使用 OpenNETCF.Desktop.Communication.dll 的 RAPI 复制文件
我目前正在使用 OpenNETCF.Desktop.Communication.dll 将文件从桌面复制到 CE 设备,但我不断收到错误:
“无法创建远程文件”
我的开发环境是 VS2005 (VB.NET)
我的代码:
ObjRapi.Connect()
ObjRapi.CopyFileToDevice("C:\results.txt", "\results.txt")
ObjRapi.Dispose()
ObjRapi.Disconnect()
有没有人遇到过这个问题,你是否设法解决了这个问题?
谢谢
I’m currently using the OpenNETCF.Desktop.Communication.dll to copy files from my desktop to a CE device, but I keep getting an error:
‘Could not create remote file’
My development environment is VS2005 (VB.NET)
My code:
ObjRapi.Connect()
ObjRapi.CopyFileToDevice("C:\results.txt", "\results.txt")
ObjRapi.Dispose()
ObjRapi.Disconnect()
Has anyone run into this and did you manage to get around it.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我以前遇到过一次这种情况,但我不太记得是什么原因造成的。
通过查看您的代码,我唯一能想到的是这一行:
我不确定,但您可以尝试将目标路径更改为不同的路径。 像这样的事情:
我现在无法真正测试这个,但我真的不明白为什么它不起作用。
编辑:我刚刚看了一些我使用 RAPI 编写的代码,当我复制我的行时,它看起来像这样:
最后的布尔值是一个覆盖开关,将其设置为 true 可能会起作用。
I have run into this once before but I can't really remember what was causing it.
The only thing I can think of from looking at your code is this line:
I'm not sure but you could try and change the destination path to something different. Something like this:
I can't really test this at the moment but I really don't see why it wouldn't work.
EDIT: I just had a look at some code that I have writen using the RAPI,when I do any copying my line looks like this:
The boolean on the end is an overwrite switch, setting that to true may work.
试试这个
Dim myrapi As New RAPI
try this
Dim myrapi As New RAPI
您必须使用以下代码:
在您的代码中,您没有提及要复制文件的路径。
希望对你有帮助。
You have to use the following code:
In your code you are not mentioning the path where you want to copy the file.
Hope this will help you.