0

我为尝试使用 RAPI 发送文件的 Windows CE 设备创建了一个 C# 程序。但是当程序到达或者更确切地说下面有这一行时,它会在 Windows.Forms.dll 版本 2.0.0.0 中显示 TypeLoad Exception 错误

using (RemoteDeviceManager r = new RemoteDeviceManager())

另外,我注意到在添加 RAPI.dll 并刷新依赖项后,我看到还有另一个 Windows.Forms.dll 已添加。现在我有一个版本 2.0.0.0 和 3.5.0.0

这是我传输文件的代码

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);

   }
  }
 }

谁能告诉我发生了什么错误?在我添加这些代码行之前,一切都运行良好。另外,如果您可能会问,我正在尝试通过 wifi 传输文件。

4

1 回答 1

0

RAPI is a desktop API library. It must be called from a PC application, not a CE application. The device cannot initiate the communication pipe (if it could, the security implication would be huge).

于 2014-10-28T15:59:26.410 回答