I've got this nice USB barcode scanner and I'd like to readthe input using the USB driver and not the keyboard input.
我有这个漂亮的USB条形码扫描仪,我想使用USB驱动程序而不是键盘输入读取输入。
How can this be accomplished using .NET? any ready libraries? I couldn't find anything of real use...
如何使用.NET实现这一目标?任何现成的库?我找不到真正有用的东西......
Thanks!
谢谢!
2 个解决方案
#1
11
If it is a USB reader, you should find the .net drivers that come with it, such that you get a class which provides the IO and perhaps more functionality.
如果它是USB读卡器,您应该找到随附的.net驱动程序,这样您就可以获得一个提供IO和更多功能的类。
If the scanner has internally a USB to Serial converter, then you should see in your Device Manager which COM port is in use by the scanner. In that case, you can use the SerialPort
class for communication to the device. Note that you should set the settings (i.e. baudrate, parity bit, stop bit, etc) correct before you can have any communication.
如果扫描仪内部有USB转串口转换器,那么您应该在设备管理器中看到扫描仪正在使用哪个COM端口。在这种情况下,您可以使用SerialPort类与设备进行通信。请注意,在进行任何通信之前,应将设置(即波特率,奇偶校验位,停止位等)设置为正确。
#2
4
You can read (and control) the device using USB HID reports.
您可以使用USB HID报告读取(和控制)设备。
http://www.codeproject.com/KB/cs/USB_HID.aspx
http://www.codeproject.com/KB/cs/USB_HID.aspx
http://www.florian-leitner.de/index.php/2007/08/03/hid-usb-driver-library/
http://www.florian-leitner.de/index.php/2007/08/03/hid-usb-driver-library/
#1
11
If it is a USB reader, you should find the .net drivers that come with it, such that you get a class which provides the IO and perhaps more functionality.
如果它是USB读卡器,您应该找到随附的.net驱动程序,这样您就可以获得一个提供IO和更多功能的类。
If the scanner has internally a USB to Serial converter, then you should see in your Device Manager which COM port is in use by the scanner. In that case, you can use the SerialPort
class for communication to the device. Note that you should set the settings (i.e. baudrate, parity bit, stop bit, etc) correct before you can have any communication.
如果扫描仪内部有USB转串口转换器,那么您应该在设备管理器中看到扫描仪正在使用哪个COM端口。在这种情况下,您可以使用SerialPort类与设备进行通信。请注意,在进行任何通信之前,应将设置(即波特率,奇偶校验位,停止位等)设置为正确。
#2
4
You can read (and control) the device using USB HID reports.
您可以使用USB HID报告读取(和控制)设备。
http://www.codeproject.com/KB/cs/USB_HID.aspx
http://www.codeproject.com/KB/cs/USB_HID.aspx
http://www.florian-leitner.de/index.php/2007/08/03/hid-usb-driver-library/
http://www.florian-leitner.de/index.php/2007/08/03/hid-usb-driver-library/