资源简介
C# USB设备检测,以及自动安全移除USB设备,源代码实例

代码片段和文件信息
// UsbEject version 1.0 March 2006
// written by Simon Mourier
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Text;
namespace TSB_Print.Class
{
///
/// A generic base class for physical devices.
///
[TypeConverter(typeof(ExpandableobjectConverter))]
public class Device : IComparable
{
private string _path;
private DeviceClass _deviceClass;
private string _description;
private string _class;
private string _classGuid;
private Device _parent;
private int _index;
private DeviceCapabilities _capabilities = DeviceCapabilities.Unknown;
private List _removableDevices;
private string _friendlyName;
private Native.SP_DEVINFO_DATA _deviceInfoData;
internal Device(DeviceClass deviceClass Native.SP_DEVINFO_DATA deviceInfoData string path int index)
{
if (deviceClass == null)
throw new ArgumentNullException(“deviceClass“);
if (deviceInfoData == null)
throw new ArgumentNullException(“deviceInfoData“);
_deviceClass = deviceClass;
_path = path; // may be null
_deviceInfoData = deviceInfoData;
_index = index;
}
///
/// Gets the device‘s index.
///
public int Index
{
get
{
return _index;
}
}
///
/// Gets the device‘s class instance.
///
[Browsable(false)]
public DeviceClass DeviceClass
{
get
{
return _deviceClass;
}
}
///
/// Gets the device‘s path.
///
public string Path
{
get
{
if (_path == null)
{
}
return _path;
}
}
///
/// Gets the device‘s instance handle.
///
public int InstanceHandle
{
get
{
return _deviceInfoData.devInst;
}
}
///
/// Gets the device‘s class name.
///
public string Class
{
get
{
if (_class == null)
{
_class = _deviceClass.GetProperty(_deviceInfoData Native.SPDRP_CLASS null);
}
return _class;
}
}
///
/// Gets the device‘s class Guid as a string.
///
public strin
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8581 2018-02-27 09:55 USB操作类\Device.cs
文件 963 2018-02-27 09:56 USB操作类\DeviceCapabilities.cs
文件 9202 2018-02-27 09:53 USB操作类\DeviceClass.cs
文件 601 2018-02-27 09:58 USB操作类\DiskDeviceClass.cs
文件 7071 2018-02-27 09:53 USB操作类\Native.cs
文件 7471 2018-02-27 09:58 USB操作类\Volume.cs
文件 1331 2018-02-27 09:53 USB操作类\VolumeDeviceClass.cs
..A.SHR 326 2018-02-27 09:59 USB操作类\vssver2.scc
文件 1134 2018-03-03 09:39 USB操作类\调用.txt
目录 0 2018-03-03 09:38 USB操作类
----------- --------- ---------- ----- ----
36680 10
- 上一篇:vb图书管理系统完整版
- 下一篇:ASP.NET 2.0开发技术习题答案
相关资源
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- 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#自定义控件
评论
共有 条评论