我怎样才能找到价值来自VB.NET中的键盘或条形码阅读器 [英] How Can I Find Value is Come From Keyboard or Barcoder Reader in VB.NET

查看:77
本文介绍了我怎样才能找到价值来自VB.NET中的键盘或条形码阅读器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VB.NET中有一个Windows应用程序。我想知道输入的值是用户来自BARCODER READER或KEYBOARD ..因为我想存储值来自

不同数据库中的键盘和不同数据库中的条形码值..

所以,请让我知道如何解决...或任何URL ....

推荐答案

如果你使用的是键盘楔形条形码扫描仪,你就不可能。对于系统来说,好像条形码来自键盘。



解决此问题需要您配置条形码扫描器以发送前缀和后缀字符扫描条形码时的条形码。然后,您必须将表单上的KeyPreview属性设置为True,并为表单KeyDown事件编写代码以查找并跟踪条形码前缀字符的进度。一旦看到该前缀,就可以收集条形码中的所有按键,直到看到后缀字符。然后你就得到了你的条形码。



如果你真的想要分开两个而不跳过火红的USB代码或特殊编码的表格,请使用条形码扫描仪和不同的接口,基于串口或以太网。这让事情变得更加容易。
If you''re using a "keyboard wedge" bar code scanner, you can''t. To the system, it appears as if the barcode was coming from the keyboard.

The work around for this requires you to configure the barcode scanner to send prefix and postfix characters to the barcode when it scans a barcode. You then have to set the "KeyPreview" property on your form to True and write code for the forms KeyDown event to look for and track the progress of the barcode prefix characters. Once you have seen that prefix, you can gather up all the keypresses in the barcode until you see the postfix characters. Then you''ve got your barcode.

If you REALLY want to seperate the two without jumping through flaming USB code or specially coded forms, use a barcode scanner with a different interface, either Serial or Ethernet based. It makes thing a lot easier to tell where things are coming from.


这篇关于我怎样才能找到价值来自VB.NET中的键盘或条形码阅读器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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