- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.IO;
- using System.Runtime.InteropServices;
- using Common.RapiDesktop.Classes;
- using OpenNETCF.Desktop.Communication;
- namespace TestUSB
- {
- public partial class Form1 : Form
- {
- HHFiles myHH;
- public Form1()
- {
- InitializeComponent();
-
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- RAPI rApi=new RAPI();
- if(rApi.DevicePresent)
- {
- MessageBox.Show("已连接");
- rApi.Disconnect();
- myHH = new HHFiles();
- String LocalFileName = @"c:\a.txt";
- String RemoteDeviceFileName = @"\DiskOnChip\a.txt";
- myHH.CopyFileToDevice(LocalFileName, RemoteDeviceFileName, true);
- MessageBox.Show("文件传输完毕");
- rApi.Disconnect();
- }
- else
- {
- MessageBox.Show("未连接");
- rApi.Disconnect();
- }
- }
- }
- }
posted on
2010-06-30 09:11
liufei
阅读(
748)
评论()
编辑
收藏
举报