我如何在C#应用程序中使用BarCode Reder [英] How can i Use BarCode Reder in C# Application

查看:86
本文介绍了我如何在C#应用程序中使用BarCode Reder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我现在在使用C#语言和SQLServer for Database开发一个系统
并且该项目使用条形码阅读器,我不知道如何使用条形码以及如何将其附加到我的项目中,谢谢您........

Hi i now develop A system in Using C# Language and SQLServer For Database
and this Project use Bar Code Reader and i do not know how to use barcode and how can i attach it to my project thanks For you attention .......

推荐答案

大约15年前,我让库存工作人员将条形码添加到公司仓库中的所有库存中.

使用的读者不需要对我的程序进行任何更改. 它连接在键盘和PC之间.用户将跳至序列号字段,按条形码阅读器上的一个按钮,然后输入扫描的序列号.无需代码.

如今,条形码读取器可能会对USB进行相同的操作.
About 15 years ago, I got the inventory crew to add barcodes to all the inventory in the company''s warehouse.

The reader used didn''t require any changes to my program. It connected between the keyboard and PC. The user would tab to the serial number field, press a button on the barcode reader, and the scanned serial number would be input. No code required.

Todays barcode readers probably do the same thing with USB.


无论RS232还是USB,条形码读取器都是串行设备,您应该查看SerialPort类以获取实现细节.它们发出标准的ASCII码,以起始码为前缀(通常为0或7),由字符和数字组成的条形码以及可选的校验和数字.条形码读取器的难点在于,有许多常用的不同条形码格式.

大约15年前,我被指示要为我工作过的一家五金店购买并实施条形码读取器,但该死的东西没有编程,也没有解释不同的格式,也没有解释我们使用的格式.幸运的是,我们有了这个崭新的东西,叫做Internet-字面上是新的,因为我是1995年或96年该地区最早注册服务的人之一,但我仍然设法在网上找到了定义.今天可能要容易得多...

总而言之,在程序中实现一个串行端口读取器,找出公司使用的条形码格式,并在Internet上搜索定义,实现例程以去除读取器发送的无关字符,并使用文本结果搜索数据库用于匹配项.

顺便说一下,这些应该是唯一的.根据通用协议,所有条形码均由两部分组成-供应商前缀和产品标识符.供应商前缀由独立的注册商分配,以保持唯一性,而产品标识符由供应商分配.同一项目的不同包装也将具有不同的代码-荧光灯泡的30件外壳与包装中的单个灯管将具有不同的代码.这对运输和收货有帮助,因为可以很容易地编写软件来接收30个30件的独立包装.
Whether RS232 or USB, barcode readers are serial devices, and you should look to the SerialPort class for implementation details. They emit standard ASCII codes, prefixed by a start code (most often 0 or 7), a barcode consisting of characters and digits, and optionally followed by a checksum digit. The tough part about barcode readers is that there are so many different barcode formats in common use.

About 15 years ago I was directed to buy and implement barcode readers for a hardware store I worked for, and the damned things came unprogrammed, and with no explanation of the different formats, nor did I have any explanation of the format we used. Fortunately we had this brand new thingy called the Internet - literally new, as I was one of the first in the area to sign up for service in 1995 or ''96 - and I still managed to find definitions on the web. It''s probably a lot easier today...

In summary, implement a serial port reader in your program, find out what barcode format your company uses and search the Internet for a definition, implement a routine to strip out irrelevant characters sent by the reader, and use the text result to search your database for matching items.

These should be unique, by the way. Under a universal agreement, all barcodes consist of two parts - a vendor prefix, and a product identifier. The vendor prefix is assigned by an independent registrar to maintain uniqueness, and the product identifier is assigned by the vendor. Different packages of the same item will have different codes, as well - a 30-piece case of fluorescent light bulbs will have a different code than a single tube from the package. This is a help in shipping and receiving, as software can be easily written to receive a case of 30 as 30 individual pieces.


这篇关于我如何在C#应用程序中使用BarCode Reder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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