从USB棒code扫描仪读取扫描仪、USB、code

2023-09-03 07:15:16 作者:Coral 珊瑚

我有了这个漂亮的USB棒code扫描仪,我想使用的USB驱动程序,而不是键盘输入readthe输入。

I've got this nice USB barcode scanner and I'd like to readthe input using the USB driver and not the keyboard input.

这怎么可能使用.NET来实现?任何现成的库?我找不到真正使用什么...

How can this be accomplished using .NET? any ready libraries? I couldn't find anything of real use...

谢谢!

推荐答案

如果它是一个USB读卡器,你会发现,随之而来,这样,你就会得到一个类,它提供的IO,也许更多的功能.NET司机

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转串口转换器,那么你应该看到在设备管理器中的COM端口是由扫描仪使用。在这种情况下,您可以使用的SerialPort 类通信设备。请注意,您应该设置的设置(如波特率,校验位,停止位等)正确的,然后才可以有任何的沟通。

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.