使用C#从USB键盘和USB条码扫描器读取输入 [英] Read input from USB keyboard and USB barcode scanner using C#

查看:1049
本文介绍了使用C#从USB键盘和USB条码扫描器读取输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我从USB条码扫描器读取文本时遇到问题.我在代码项目iteif中找到了有关此的文章.它的工作在这里很好.但是问题出在客户使用USB键盘的地方.因此,我的代码没有区分键盘或扫描仪的输入,两者都被识别为HID设备.我只需要从sacnner读取数据到特定的文本框,这是我非常需要的.如果有任何建议,请回复我..

解决方案

由于条形码扫描仪通常提供的输入就像来自键盘一样,所以我认为没有您实际上可以做的任何事情. USB设备的全部要点是它可以集成,而不是标识自己.除非您可以从在按键事件中发送的EventArgs中识别出设备,否则我会说您至少是用C#进行了软管连接. 我在USB条形码扫描仪上遇到困难.
如果在您的终端上正常工作

请给我您的示例代码
谢谢

basith7861@gmail.com


您可以给我发送文章链接吗?关于条形码阅读器?
你能把源代码发给我吗?
waqasberet@gmail.com


Hi,

I have a problem with reading text from USB barcode scanner. I found an article about this in code project itseif. Its working pretty much fine here. But problem is at the client place they are using the USB keyboard. So My code not differenciating the input from keyboard or scanner.Both are identifying as HID devices. I need to read data to a particular text box only from the sacnner.This is very much required for me. please reply me if any suggesstions ..

解决方案

As a barcode scanner typically provides input as if it came from the keyboard, I don''t think there''s really anything you can do. The whole point of a USB device is that it integrates, not that it identifies itself. Unless you can identify the device from the EventArgs you''re sent in the keypress event, I''d say you are hosed, in C# at least.


HI Im having hardtime here in usb barcode scanner.
if it is working on ur end

Please send me ur sample code
thanks

basith7861@gmail.com


can u send me the article link? about bar-code reader?
and can u please send me the source code at
waqasberet@gmail.com


这篇关于使用C#从USB键盘和USB条码扫描器读取输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆