简体   繁体   English

使用C#将文件复制到Windows CE设备

[英]Copying file to windows ce device using c#

I have a portable windows ce device. 我有一台便携式Windows ce设备。 I am writing an application to copy files from windows 7 to windows ce using RAPI. 我正在编写一个使用RAPI将文件从Windows 7复制到Windows CE的应用程序。 This is the code i use. 这是我使用的代码。

Mobile.Device.CopyFileToDevice(@"C:\Users\username\AppData\Local\Temp\AssetList.xml”, @“\Flash Disk\AMM\AssetList.xml”);

Both paths and files exist. 路径和文件都存在。 When it reaches that line of code it throws an error 当到达那行代码时,它将引发错误

 "object reference not set to an instance of an object".

When i look on the device a AssetList.xml gets created with 0 kb . 当我在设备上查看时,使用0 kb创建AssetList.xml。 Please help. 请帮忙。

One of your problems is that you are missing a quote " . Your code should not even compile, so change 您的问题之一是您缺少引号 。您的代码甚至不应编译,因此请更改

Mobile.Device.CopyFileToDevice(C:\Users\username\AppData\Local\Temp\AssetList.xml"

to

Mobile.Device.CopyFileToDevice("C:\Users\username\AppData\Local\Temp\AssetList.xml"

Try This: 尝试这个:

    RAPI rapi = new RAPI();
    rapi.Connect(true, 10);
    rapi.CopyFileToDevice(localFile, remoteFile, true);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM