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

1.4k views Asked by At

I have created a C# program for Windows CE device that tries to send file using 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

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. Now I had a version 2.0.0.0 and 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.

1

There are 1 answers

0
ctacke On

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