如何在C#.net中使用条形码扫描仪扫描条形码不干胶标签上打印的条形码 [英] how to scan barcode printed on barcode sticker with barcode scanner in C#.net

查看:210
本文介绍了如何在C#.net中使用条形码扫描仪扫描条形码不干胶标签上打印的条形码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想编写代码,以便可以从打印的条形码标签上扫描条形码并将其解码以在文本框中显示文本.

我不知道如何在条形码触发器上编写代码.

解决方案



大多数条形码扫描仪都充当Windows系统的键盘.这意味着您无法确定键盘输入和扫描的条形码之间的差异.您需要做的是:
1.将焦点置于要输入扫描代码的输入框
2.扫描条形码
->扫描的代码会自动写入输入字段,您会收到例如文本更改的事件.


提示:当扫描程序通常以字符串形式读取数据并将其保存在剪贴板中并将其粘贴到编辑框或活动的窗口中时,...
例如,如果您打开记事本并扫描某些内容,则在记事本中您会看到一些数字,例如83712787878,因此这是扫描的条形码:)

查看这些链接;

http://msdn.microsoft.com/en-us/library/aa446489.aspx [ ^ ]

http://stackoverflow.com/questions/613881/how-从条形码阅读器读取值 [ CP条形码文章 [ 解决方案

Hi,

most Barcode scanners act as a keyboard to your windows system. This means that you can''t determine the difference between a keyboard input and a scanned barcode. All you need to do is:
1. Set focus to the input box where the scanned code is to be entered
2. Scan the barcode
--> The scanned code is automatically written in the input field and you receive a e.g. textchanged event.


HINT: When a scanners usually reads data as string and keeps it in clipboard and paste it in an editbox or what is active...
For example, if you open notepad and scan something, in notepad you will see some numbers such as 83712787878 so this is the scanned barcode :)

Check out these links;

http://msdn.microsoft.com/en-us/library/aa446489.aspx[^]

http://stackoverflow.com/questions/613881/how-to-read-a-value-from-a-barcode-reader[^]

Get the .NET SDK from the intermec website and install it.
There are examples on how to do this in the SDK;
something that might help

private Intermec.DataCollection.BarcodeReader barcodeReader;

barcodeReader = new BarcodeReader();// creating an instance

barcodeReader.BarcodeRead +=new
BarcodeReadEventHandler(barcodeReader_BarcodeRead);

barcodeReader.ThreadedRead(true);//read continuously

private void barcodeReader_BarcodeRead(object sender,
BarcodeReadEventArgs bre)
{
    
    string MyBarcode;

    MyBarcode = bre.strDataBuffer;   

}

private void DisposeBCR()
{
    barcodeReader.Dispose()
}


There are lot of articles here on CodeProject itself. Have a look at them and pick the one that suits you to start off.
CP Barcode articles[^]


这篇关于如何在C#.net中使用条形码扫描仪扫描条形码不干胶标签上打印的条形码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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