0

我有一个便携式 windows ce 设备。我正在编写一个应用程序来使用 RAPI 将文件从 windows 7 复制到 windows ce。这是我使用的代码。

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

路径和文件都存在。当它到达那行代码时,它会抛出一个错误

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

当我在设备上查看时,会使用 0 kb 创建 AssetList.xml。请帮忙。

4

2 回答 2

0

尝试这个:

    RAPI rapi = new RAPI();
    rapi.Connect(true, 10);
    rapi.CopyFileToDevice(localFile, remoteFile, true);
于 2013-11-01T13:20:16.690 回答
0

您的问题之一是您缺少引号"。您的代码甚至不应该编译,因此请更改

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

Mobile.Device.CopyFileToDevice("C:\Users\username\AppData\Local\Temp\AssetList.xml"
于 2013-11-01T13:16:08.780 回答