资源简介
C#+串口和USB通信编程(代码)C#+串口和USB通信编程(代码)C#+串口和USB通信编程(代码) C#+串口和USB通信编程(代码)C#+串口和USB通信编程(代码)C#+串口和USB通信编程(代码)

代码片段和文件信息
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;
namespace USB
{
public partial class Form1 : Form
{
public const int WM_DEVICECHANGE = 0x219;
public const int DBT_DEVICEARRIVAL = 0x8000;
public const int DBT_CONFIGCHANGECANCELED = 0x0019;
public const int DBT_CONFIGCHANGED = 0x0018;
public const int DBT_CUSTOMEVENT = 0x8006;
public const int DBT_DEVICEQUERYREMOVE = 0x8001;
public const int DBT_DEVICEQUERYREMOVEFAILED = 0x8002;
public const int DBT_DEVICEREMOVECOMPLETE = 0x8004;
public const int DBT_DEVICEREMOVEPENDING = 0x8003;
public const int DBT_DEVICETYPESPECIFIC = 0x8005;
public const int DBT_DEVNODES_CHANGED = 0x0007;
public const int DBT_QUERYCHANGECONFIG = 0x0017;
public const int DBT_USERDEFINED = 0xFFFF;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
}
protected override void WndProc(ref Message m)
{
try
{
if (m.Msg == WM_DEVICECHANGE)
{
switch (m.WParam.ToInt32())
{
case WM_DEVICECHANGE://
break;
case DBT_DEVICEARRIVAL://U盘插入
DriveInfo[] s = DriveInfo.GetDrives();
foreach (DriveInfo drive in s)
{
if (drive.DriveType == DriveType.Removable)
{
richTextBox1.AppendText(“U盘已插入,盘符为:“ + drive.Name.ToString() + “\r\n“);
break;
}
}
break;
case DBT_CONFIGCHANGECANCELED:
MessageBox.Show(“2“);
break;
case DBT_CONFIGCHANGED:
MessageBox.Show(“3“);
break;
case DBT_CUSTOMEVENT:
MessageBox.Show(“4“);
break;
case DBT_DEVICEQUERYREMOVE:
MessageBox.Show(“5“);
break;
case DBT_DEVICEQUERYREMOVEFAILED:
MessageBox.Show(“6“);
break;
case DBT_DEVICEREMOVECOMPLETE: //U盘卸载
richTextBox1.AppendText(“U盘已卸载,盘符为:“);
break;
case DBT_DEVICEREMOVEPENDING:
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 922 2008-06-24 11:47 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort.sln
..A..H. 14848 2008-06-27 09:56 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort.suo
文件 6820 2008-06-24 16:00 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Form1.cs
文件 4747 2008-06-24 14:29 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Form1.Designer.cs
文件 6008 2008-06-24 14:29 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Form1.resx
文件 3229 2008-06-24 12:00 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\HexCommPort.csproj
文件 470 2008-06-24 11:47 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Program.cs
文件 24576 2008-06-24 16:00 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\bin\Debug\HexCommPort.exe
文件 26112 2008-06-24 16:00 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\bin\Debug\HexCommPort.pdb
文件 5632 2005-12-08 14:51 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\bin\Debug\HexCommPort.vshost.exe
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\bin\Debug
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\bin
文件 296 2008-06-27 09:54 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\HexCommPort.csproj.FileList.txt
文件 842 2008-06-24 14:29 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\Debug\HexCommPort.csproj.GenerateResource.Cache
文件 24576 2008-06-24 16:00 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\Debug\HexCommPort.exe
文件 180 2008-06-24 14:29 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\Debug\HexCommPort.Form1.resources
文件 26112 2008-06-24 16:00 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\Debug\HexCommPort.pdb
文件 180 2008-06-24 12:00 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\Debug\HexCommPort.Properties.Resources.resources
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\Debug\Refactor
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\Debug\TempPE
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj\Debug
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\obj
文件 1184 2008-06-24 11:47 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Properties\AssemblyInfo.cs
文件 2876 2008-06-24 11:47 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Properties\Resources.Designer.cs
文件 5612 2008-06-24 11:47 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Properties\Resources.resx
文件 1094 2008-06-24 11:47 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Properties\Settings.Designer.cs
文件 249 2008-06-24 11:47 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Properties\Settings.settings
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort\Properties
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort\HexCommPort
目录 0 2008-07-04 12:41 C# 串口和USB通信编程\串口\HexCommPort
............此处省略75个文件信息
- 上一篇:基于C#的窗体弹球小程序
- 下一篇:WPF中的DateTimePicker控件
相关资源
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
评论
共有 条评论