条形码扫描事件?
我有一个简单的 USB 条形码阅读器,我打算用它来扫描 COD 39 条形码。我知道,只需在文本字段处于焦点状态时扫描条形码即可获得正在扫描的条形码的文本输入。但是我的要求有点不同。
我需要创建一个 C# 应用程序,在读取条形码时,它将使用列表检查读取的条形码,我必须查看它是否存在。问题是我无法始终使应用程序上的文本框保持焦点,因为该应用程序也可以执行其他操作。相反,我想要的是我的程序继续寻找某种“事件”,一旦条形码扫描仪扫描代码,就会引发这种“事件”。
那么有谁知道在扫描条形码某些代码时是否会引发这样的事件,以便我可以在扫描仪扫描条形码时指示我的程序完成其余的工作?
I have a simple USB barcode reader which I intend to use to scan COD 39 barcodes. I know that just scanning the barcode while having a text field on focus will get me the text input of the barcode I'm scanning. However my requirement is a bit different.
I need to create a C# application where upon reading a barcode it will check the read barcode with a list I have to see whether it exists. The problem is I cannot keep a text box on my app in focus all the time as the app does other things as well. Instead what I want is for my program to keep looking for some sort of "event" which will be raised once the bar code scanners scans a code.
So does anyone know if there is such an event which will be raised when the barcode is scanned some code so I can instruct my program to do the rest of the work when the scanners scans a barcode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
理想情况下,扫描仪会附带某种您可以使用的 SDK 或库。
不太理想的是,您可能不得不像读取串行端口一样读取它。
实际上,您可能应该阅读以下链接。当我正在寻找如何做到这一点时,我在 StackOverflow 上遇到了类似的帖子,并给出了类似的答案。
从 USB 条形码扫描仪读取
Ideally, the scanner would've come with some kind of SDK or library that you could use.
Less ideally, you may have to resort to reading it as if it's a serial port.
Actually, you should probably read the following link instead. as I was looking up how to do that, I ran into a similar post already on StackOverflow with a similar answer.
Reading from an USB barcode scanner