C#中的条码扫描器控制 [英] Barcode scanner control in C#

查看:369
本文介绍了C#中的条码扫描器控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



如何控制条码扫描器只将数据发送到其Barcodtext.text

假设我有3个当用户扫描项目时,输入文本框围绕表单我只需将条形码数据发送到Barcodtext即使用户专注于另一个文本框也是如此。



我有什么尝试过:



i尝试了很多关于此的代码,但我失败了

Hi all ,

how can i control the barcode scanner to send data only into its Barcodtext.text
suppose i have 3 input textboxs arround the form when user scann an item i just need to send barcode data into Barcodtext even if user is focus in another textbox .

What I have tried:

i tried alot of codes about this but i failed

推荐答案

条码扫描器几乎所有的船都设置为键盘,因此当您扫描代码时,字符将作为击键输入到Windows键盘队列中。不幸的是,Windows不记录源,因此一旦扫描开始,您无法判断它是否在连接到系统的(可能的)键盘设备之一上键入或扫描。



为了解决这个问题,大多数扫描仪可以设置为提供引入和尾部序列,您可以在软件中识别出条形码即将来临和条形码结束并转移您需要的任何地方的数据。



但是......每个制造商(有时甚至是模型)都需要不同的流程来配置它们。您必须与特定扫描仪的制造商联系,以了解如何设置序列。
Barcode scanners nearly all ship set to act as a keyboard, so when you scan a code the characters are fed as keystrokes into Windows keyboard queue. Unfortunately, Windows does not record the source, so once the scan is started you cannot tell if it was typed on one of the (many possible) keyboard devices attached to the system, or scanned.

To get round this, most scanners can be set to provide "lead in" and "tail out" sequences that you can identify in your software to say "barcode coming", and "barcode ended" and divert the data anywhere you need to.

But ... each manufacturer (and sometimes even model) needs a different process to configure these. You will have to speak to the manufacturer of your specific scanner to find out how to set the sequences.


这篇关于C#中的条码扫描器控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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