winusb_cs_20

所属分类:USB编程
开发工具:C#
文件大小:225KB
下载次数:37
上传日期:2013-08-24 20:59:45
上 传 者深海-99
说明:  C# USB HID 里面包括了源码,能编过。
(C# USB HID source code can be compiled.)

文件列表:
winusb_cs (0, 2013-05-04)
winusb_cs\app.config (144, 2013-03-10)
winusb_cs\AssemblyInfo.cs (883, 2013-04-17)
winusb_cs\bin (0, 2013-05-04)
winusb_cs\bin\Debug (0, 2013-05-04)
winusb_cs\bin\Debug\WinUsbDemo.exe (32768, 2013-05-04)
winusb_cs\bin\Debug\WinUsbDemo.exe.config (144, 2013-03-10)
winusb_cs\bin\Debug\WinUsbDemo.vshost.exe (22472, 2013-05-04)
winusb_cs\bin\Debug\WinUsbDemo.vshost.exe.config (144, 2013-03-10)
winusb_cs\bin\Debug\WinUsbDemo.vshost.exe.manifest (490, 2012-06-02)
winusb_cs\bin\Release (0, 2013-05-04)
winusb_cs\bin\Release\WinUsbDemo.exe (32768, 2013-05-04)
winusb_cs\bin\Release\WinUsbDemo.exe.config (144, 2013-03-10)
winusb_cs\bin\Release\WinUsbDemo.vshost.exe (22472, 2013-05-04)
winusb_cs\bin\Release\WinUsbDemo.vshost.exe.config (144, 2013-03-10)
winusb_cs\bin\Release\WinUsbDemo.vshost.exe.manifest (490, 2012-06-02)
winusb_cs\DeviceManagement.cs (13160, 2013-04-17)
winusb_cs\DeviceManagementApi.cs (4049, 2013-04-17)
winusb_cs\FileIOApi.cs (1031, 2013-04-17)
winusb_cs\frmMain.cs (48118, 2013-05-04)
winusb_cs\frmMain.resx (6183, 2008-06-03)
winusb_cs\inf (0, 2013-05-04)
winusb_cs\inf\winusbdemo.inf (2611, 2008-02-23)
winusb_cs\obj (0, 2013-05-04)
winusb_cs\obj\Debug (0, 2013-05-04)
winusb_cs\obj\Debug\DesignTimeResolveAssemblyReferences.cache (1156, 2013-03-13)
winusb_cs\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache (6613, 2013-05-04)
winusb_cs\obj\Debug\Refactor (0, 2009-02-12)
winusb_cs\obj\Debug\TempPE (0, 2013-05-04)
winusb_cs\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll (4608, 2013-03-12)
winusb_cs\obj\Debug\WinUsbDemo.exe (32768, 2013-05-04)
winusb_cs\obj\Debug\WinUsbDemo.FrmMain.resources (180, 2013-04-29)
winusb_cs\obj\Debug\WinUsbDemo.Properties.Resources.resources (180, 2013-04-29)
winusb_cs\obj\Debug\WinUsb_cs.csproj.GenerateResource.Cache (977, 2013-04-29)
winusb_cs\obj\Debug\WinUsb_cs.csprojResolveAssemblyReference.cache (1748, 2013-04-30)
winusb_cs\obj\Release (0, 2013-05-04)
winusb_cs\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache (6617, 2013-05-04)
winusb_cs\obj\Release\TempPE (0, 2013-05-04)
winusb_cs\obj\Release\TempPE\Properties.Resources.Designer.cs.dll (4608, 2013-05-04)
winusb_cs\obj\Release\WinUsbDemo.exe (32768, 2013-05-04)
... ...

/// /// Project: WinUsb_cs /// /// *********************************************************************** /// 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 created using Visual Studio 2012 Professional Edition with .NET Framework 4.0. /// /// Purpose: /// Demonstrates USB communications using Microsoft's WinUSB driver. /// /// Requirements: /// Windows XP or later and an attached USB device that uses the WinUSB driver. /// /// Description: /// Finds an attached device whose device firmware or host INF file contains a specific device interface GUID. /// Enables sending and receiving data via bulk, interrupt, and control transfers. /// /// Uses RegisterDeviceNotification and WM_DEVICE_CHANGE messages /// to detect when a device is attached or removed. /// /// For bulk transfers, the application uses a Delegate and the BeginInvoke /// and EndInvoke methods to read and write data asynchronously so the application's main thread /// doesn't have to wait for the device to return data. A callback routine uses /// marshaling to send data to the form, whose code runs in a different thread. /// /// Interrupt and control transfers read and write data synchronously, blocking the thread /// until the operation completes or a timeout. (Normally, the wait for completion is minimal.) /// /// This software, an example INF file, and companion device firmware are available from /// www.Lvr.com /// /// Send bug reports to jan@Lvr.com /// This application has been tested under Windows XP (32 bit) and Windows 8 (*** bit). /// /// 5/3/13 /// V2.0 /// To illustrate asynchronous operations, bulk read and write are asynchronous. /// /// To illustrate synchronous operations, interrupt read and write and control transfers are synchronous. /// /// For compatibility, replaced ToInt32 with ToInt*** here: /// IntPtr pDevicePathName = new IntPtr(detailDataBuffer.ToInt***() + 4); /// and here: /// if ((deviceNotificationHandle.ToInt***() == IntPtr.Zero.ToInt***())) /// /// Uncommented QueryDeviceSpeed because Microsoft corrected the documentation for it. /// /// Renamed some routines and variables. /// /// Moved myDevInfo and other variables from WinUsbDevice.cs to frmMain.cs. /// /// For compatibility if the charset isn't English, added System.Globalization.CultureInfo.InvariantCulture here: /// if ((String.Compare(DeviceNameString, mydevicePathName, true, System.Globalization.CultureInfo.InvariantCulture) == 0)) /// /// Moved API declarations to classes named NativeMethods as recommended by Microsoft. /// /// Minor changes to API declarations as advised by Visual Studio's Code Analysis. /// /// Naming changes and other minor coding improvements as recommended by the Resharper tool. /// /// /// The application's form. Buttons enable detecting a device /// and initiating transfers. ///

近期下载者

相关文件


收藏者