C# 使用c将文件复制到windows ce设备#
我有一个便携式windows ce设备。我正在编写一个应用程序,使用RAPI将文件从windows 7复制到windows ce。 这是我使用的代码C# 使用c将文件复制到windows ce设备#,c#,windows-ce,rapi,C#,Windows Ce,Rapi,我有一个便携式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 t
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。请提供帮助。您的问题之一是缺少一个引号“。您的代码甚至不应该编译,所以请更改
Mobile.Device.CopyFileToDevice(C:\Users\username\AppData\Local\Temp\AssetList.xml"
到
试试这个:
RAPI rapi = new RAPI();
rapi.Connect(true, 10);
rapi.CopyFileToDevice(localFile, remoteFile, true);
这是您的真实代码吗?您错过了路径开头的
“
。对不起,代码有变量。我将进行编辑。@LuckyLuke2:您是否已使用Active Sync将PDA正确连接到PC,请检查连接是否正确。
RAPI rapi = new RAPI();
rapi.Connect(true, 10);
rapi.CopyFileToDevice(localFile, remoteFile, true);