如何识别条形码扫描仪数据 [英] How to recognized barcode scanner data

查看:198
本文介绍了如何识别条形码扫描仪数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊重Sir / s,



我一直在开发Windows应用程序,其中我使用条形码扫描仪读取条形码数据。

在我的胜利形式我有很多文本框控制。除此之外,只有一个文本框控件(txtBarcode)被编程用于条形码阅读器。



但是每当条形码扫描器读取数据时,它应该进入txtBarcode文本框尽管当前的主动控制是哪个。



表示即使当前焦点在任何其他文本框或任何其他控件上,如果同时条形码扫描器读取数据,那么该数据应该自动进行进入txtBarcode控制。



i尝试了很多但失败了..

请帮帮我。



谢谢。

解决方案

条形码扫描器像键盘输入一样工作。当条形码扫描器读取条形码时,它会生成一个文本,并像键盘事件一样发送该测试。

始终记住这一点,使用一个条形码扫描仪和一个键盘使用两个键盘是相同的。所以

您需要捕获原始设备输入,以便您知道从哪个设备获得该输入。如果您知道它来自条形码,您只需将文本发送到barcodetextbox。

有关原始设备输入的更多详细信息,请查看此链接。

使用C#的原始输入来处理多个键盘 [ ^ ]

Respected Sir/s,

I have been developing windows application in which i am using barcode scanner for read barcode data.
in my win form i have many textbox control. outof those, only one textbox control(txtBarcode) is programmed for barcode reader.

But whenever barcode scanner read the data, it should goes into that txtBarcode textbox in spite of current active control is whichever.

means even current focus is at any other textbox or any other control and if meanwhile barcode scanner reads a data then that data should be goes automatically into txtBarcode control.

i have tried much but failed..
please help me.

Thank you.

解决方案

Bar code scanner work like keyboard entry. when a barcode scanner read a barcode it generates a text and send that test as like keyboard events.
always keep this in mind using two keyboard is same using one barcode scanner and a keyboard. so
you need to capture raw device input so that you know from which device you get that input. if you know it come from barcode you just send the text to barcodetextbox.
more details on raw device input please check this link.
Using Raw Input from C# to handle multiple keyboards[^]


这篇关于如何识别条形码扫描仪数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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