资源简介
是用C#写的读取USB HID设备的测试软件,输入VID、PIV,查找HID设备是否存在,如果存在,则读取指定的HID设备发来的数据。软件已测试,可以直接使用。(不可读取键盘、鼠标),只能读取自定义HID设备,同时可以自定义读取数据时的超时时间

代码片段和文件信息
using Microsoft.Win32.SafeHandles;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
///
/// Project: GenericHid
///
/// ***********************************************************************
/// Software License Agreement
///
/// Licensor grants any person obtaining a copy of this software (“You“)
/// a worldwide royalty-free non-exclusive license for the duration of
/// the copyright free of charge to store and execute the Software in a
/// computer system and to incorporate the Software or any portion of it
/// in computer programs You write.
///
/// THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
/// IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
/// LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
/// ***********************************************************************
///
/// Author
/// Jan Axelson
///
/// This software was written using Visual Studio 2008 Standard Edition and building
/// for the .NET framework 2.0.
///
/// Purpose:
/// Demonstrates USB communications with a generic HID-class device
///
/// Requirements:
/// Windows 98 or later and an attached USB generic Human Interface Device (HID).
///
/// Description:
/// Finds an attached device that matches the vendor and product IDs in the form‘s
/// text boxes.
///
/// Retrieves the device‘s capabilities.
/// Sends and requests HID reports.
///
/// Uses RegisterDeviceNotification() and WM_DEVICE_CHANGE messages
/// to detect when a device is attached or removed.
/// RegisterDeviceNotification doesn‘t work under Windows 98 (not sure why).
///
/// A list box displays the data sent and received
/// along with error and status messages.
/// Combo boxes select data to send and 1-time or timed periodic transfers.
///
/// You can change the size of the host‘s Input report buffer and request to use control
/// transfers only to exchange Input and Output reports.
///
/// To view additional debugging messages in the Visual Studio development environment
/// select the Debug build (Build > Configuration Manager > Active Solution Configuration)
/// and view the Output window (View > Other Windows > Output)
///
/// The application uses an asynchronous FileStream to read
/// Input reports asynchronously so the application‘s main thread doesn‘t have to
/// wait for the device to return an Input report when the HID driver‘s buffer is empty.
///
/// For code that finds a device and opens handles to it see the FindTheHid routine in frmMain.cs.
/// For code that reads from the device search for fileStre
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3570 2015-07-01 14:17 generic_hid_cs\GenericHid.sln
..A..H. 51712 2015-05-04 18:32 generic_hid_cs\GenericHid.suo
..A..H. 99328 2015-07-01 17:21 generic_hid_cs\GenericHid.v11.suo
文件 30208 2015-06-30 18:23 generic_hid_cs\GenHipApp\bin\Debug\GenericHid.dll
文件 60928 2015-06-30 18:23 generic_hid_cs\GenHipApp\bin\Debug\GenericHid.pdb
文件 23552 2015-07-01 14:15 generic_hid_cs\GenHipApp\bin\Debug\GenHipApp.exe
文件 40448 2015-07-01 14:15 generic_hid_cs\GenHipApp\bin\Debug\GenHipApp.pdb
文件 21472 2015-07-01 14:15 generic_hid_cs\GenHipApp\bin\Debug\GenHipApp.vshost.exe
文件 490 2010-03-17 22:39 generic_hid_cs\GenHipApp\bin\Debug\GenHipApp.vshost.exe.manifest
文件 53162 2015-07-01 14:34 generic_hid_cs\GenHipApp\FrmMain.cs
文件 6183 2015-07-01 14:06 generic_hid_cs\GenHipApp\FrmMain.resX
文件 3811 2014-01-16 09:12 generic_hid_cs\GenHipApp\GenHipApp.csproj
文件 1229 2015-07-01 11:46 generic_hid_cs\GenHipApp\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6942 2015-05-05 18:05 generic_hid_cs\GenHipApp\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 180 2015-06-30 18:23 generic_hid_cs\GenHipApp\obj\x86\Debug\GenericHid.Properties.Resources.resources
文件 845 2015-07-01 14:15 generic_hid_cs\GenHipApp\obj\x86\Debug\GenHipApp.csproj.FileListAbsolute.txt
文件 849 2015-07-01 14:06 generic_hid_cs\GenHipApp\obj\x86\Debug\GenHipApp.csproj.GenerateResource.Cache
文件 7480 2015-06-30 18:23 generic_hid_cs\GenHipApp\obj\x86\Debug\GenHipApp.csprojResolveAssemblyReference.cache
文件 23552 2015-07-01 14:15 generic_hid_cs\GenHipApp\obj\x86\Debug\GenHipApp.exe
文件 40448 2015-07-01 14:15 generic_hid_cs\GenHipApp\obj\x86\Debug\GenHipApp.pdb
文件 180 2015-07-01 14:06 generic_hid_cs\GenHipApp\obj\x86\Debug\Synoxo.Wangjunhua.FrmMain.resources
文件 4608 2015-07-01 14:34 generic_hid_cs\GenHipApp\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 502 2015-07-01 14:34 generic_hid_cs\GenHipApp\Program.cs
文件 1374 2013-07-10 20:17 generic_hid_cs\GenHipApp\Properties\AssemblyInfo.cs
文件 2867 2015-07-01 14:34 generic_hid_cs\GenHipApp\Properties\Resources.Designer.cs
文件 5612 2013-07-10 20:17 generic_hid_cs\GenHipApp\Properties\Resources.resx
文件 1113 2015-07-01 14:34 generic_hid_cs\GenHipApp\Properties\Settings.Designer.cs
文件 249 2013-07-10 20:17 generic_hid_cs\GenHipApp\Properties\Settings.settings
文件 1133 2014-02-15 11:34 generic_hid_cs\USBHiDLib\AssemblyInfo.cs
文件 30208 2015-07-01 14:34 generic_hid_cs\USBHiDLib\bin\Debug\GenericHid.dll
............此处省略92个文件信息
相关资源
- C# TIP文件生成和拆解
- 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#版保龄球记分代码
评论
共有 条评论