简体   繁体   English

使用RAPI将文件从Windows CE设备传输到台式计算机

[英]Transferring file using RAPI from Windows CE device to a desktop computer

I have created a C# program for Windows CE device that tries to send file using RAPI. 我为Windows CE设备创建了一个C#程序,试图使用RAPI发送文件。 but when the program reached or rather has this line below, it shows an error of TypeLoad Exception in the Windows.Forms.dll Version 2.0.0.0 但是当程序到达或者更确切地说是在下面有此行时,它在Windows.Forms.dll版本2.0.0.0中显示TypeLoad Exception错误

using (RemoteDeviceManager r = new RemoteDeviceManager())

Also, I noticed that after I added the RAPI.dll and refreshed the dependencies, I saw that there is another Windows.Forms.dll that has been added. 另外,我注意到在添加RAPI.dll并刷新依赖关系后,我发现还添加了另一个Windows.Forms.dll。 Now I had a version 2.0.0.0 and 3.5.0.0 现在我有一个版本2.0.0.0和3.5.0.0

This is my code for transferring the file 这是我传输文件的代码

using (RemoteDeviceManager r = new RemoteDeviceManager())
{
 using (RemoteDevice dev = r.Devices.FirstConnectedDevice)
  { 
   if (dev == null)
   {
    //nop
   }
   else
   {
    string destFolder = dev.GetFolderPath(SpecialFolder.Desktop);
    string destFile = destFolder + @"\SharedFolder" + logfileName;
    RemoteFile.CopyFileToDevice(dev, destFile, localFilePath, true);

   }
  }
 }

Can anyone tell me what happened wrong? 谁能告诉我发生了什么事吗? Everything is working perfectly before I added these lines of code. 在添加这些代码行之前,一切工作正常。 Also, I am trying to transfer the file through wifi, if you might ask. 另外,如果您需要的话,我正在尝试通过wifi传输文件。

RAPI is a desktop API library. RAPI是一个桌面 API库。 It must be called from a PC application, not a CE application. 必须从PC应用程序而不是CE应用程序调用它。 The device cannot initiate the communication pipe (if it could, the security implication would be huge). 设备无法启动通信管道(如果可能的话,安全隐患将非常巨大)。

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

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