zoukankan      html  css  js  c++  java
  • 从PC拷文件至PDA移动设备 windows CE

    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. }  
  • 相关阅读:
    [CF1475F] Unusual Matrix
    [JXOI2018] 游戏
    [ZJOI2010] 排列计数
    [CF1474E] What Is It?
    [CF375D] Tree and Queries
    [CF519E] A and B and Lecture Rooms
    [CF321C] Ciel the Commander
    [CF1C] Ancient Berland Circus
    [CF321A] Ciel and Robot
    [CF1450C1] Errich-Tac-Toe (Easy Version)
  • 原文地址:https://www.cnblogs.com/liufei88866/p/1768022.html
Copyright © 2011-2022 走看看