C# 如何将条码扫描器集成到 ASP.NET Web 应用程序中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2198593/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 00:19:11  来源:igfitidea点击:

How to integrate barcode scanner into an ASP.NET Web application?

c#asp.netbarcode-scanner

提问by ACP

  • How to integrate barcode scanner into an ASP.NET Web application?

  • Any open source library for doing it?

  • 如何将条码扫描器集成到 ASP.NET Web 应用程序中?

  • 任何开源库可以做到这一点?

回答by Rubens Farias

You (probably) will not have a barcode scanner into your server, but on user computers.

您(可能)不会在您的服务器上安装条形码扫描仪,而是在用户计算机上安装。

A barcode scanner typically reads a barcode, understand it, and to make that read data to be understood by your computer as entered by keyboard. So you'll just need to send that data to server to be processed.

条码扫描器通常读取条码,理解它,并使计算机能够理解键盘输入的读取数据。所以你只需要将该数据发送到服务器进行处理。

EDIT:I don't have experience on reading barcodes, by you can look into this link to find how to create them: C# Barcode Generator WebService. Maybe you should buy one component for both tasks.

编辑:我没有阅读条形码的经验,您可以查看此链接以了解如何创建它们:C# Barcode Generator WebService。也许您应该为这两项任务购买一个组件。

回答by Mehmet AV?AR

If you need the barcode written into a textbox, you'll not need extra work to do. Barcode scanners simulate keypress event. Even you can handle window.keypress event to hook the preamble and postamble characters. That way the client do not need to focus on the specific textbox.

如果您需要将条码写入文本框,则无需额外工作。条码扫描器模拟按键事件。即使您可以处理 window.keypress 事件来挂钩前导和后导字符。这样客户端就不需要关注特定的文本框。

Or else the reader uses a hardware driver (? don't know such vendors exists ?) , then you'll need an ActiveX object to wrap the library.

或者读者使用硬件驱动程序(?不知道这样的供应商存在吗?),那么您将需要一个 ActiveX 对象来包装库。