从PC拷文件至PDA移动设备windows CE - IT - 博客园
  1. using System;   
  2. using System.Collections.Generic;   
  3. using System.ComponentModel;   
  4. using System.Data;   
  5. using System.Drawing;   
  6. using System.Text;   
  7. using System.Windows.Forms;   
  8. using System.IO;   
  9. using System.Runtime.InteropServices;   
  10. using Common.RapiDesktop.Classes;   
  11. using OpenNETCF.Desktop.Communication;   
  12. namespace TestUSB   
  13. {   
  14.     public partial class Form1 : Form   
  15.     {   
  16.         HHFiles myHH;    
  17.         public Form1()   
  18.         {   
  19.             InitializeComponent();   
  20.                
  21.         }   
  22.     
  23.         private void button1_Click(object sender, EventArgs e)   
  24.         {   
  25.             RAPI rApi=new RAPI();   
  26.             if(rApi.DevicePresent)   
  27.             {   
  28.                 MessageBox.Show("已连接");   
  29.                 rApi.Disconnect();    
  30.                 myHH = new HHFiles();   
  31.                 String LocalFileName = @"c:\a.txt";   // 本地计算机文件名    
  32.                 String RemoteDeviceFileName = @"\DiskOnChip\a.txt";  // 远程设备文件名   
  33.                 myHH.CopyFileToDevice(LocalFileName, RemoteDeviceFileName, true);   
  34.                 MessageBox.Show("文件传输完毕");   
  35.                 rApi.Disconnect();    
  36.             }   
  37.             else  
  38.             {   
  39.                 MessageBox.Show("未连接");   
  40.                 rApi.Disconnect();    
  41.             }   
  42.         }   
  43.     }   
  44. }  
郑重声明:资讯 【从PC拷文件至PDA移动设备windows CE - IT - 博客园】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——