c#读条码程序
来源:互联网 发布:中国近代报刊数据库 编辑:程序博客网 时间:2024/06/11 22:38
其实,条形码读取器就相当于键盘(I/O)设备,只要设置输入焦点,扫描枪扫描一下就能够显示出数据来!
protected Intermec.DataCollection.BarcodeReader gScanner;
public Scan()
{
InitializeComponent();
}
#region Intermec 扫描处理
#region 启动Intermec扫描
protected void OpenScanner()
{
if (Common.exceptionFlag == "0")
{
Application.DoEvents();
if (gScanner != null)
{
return;
}
try
{
gScanner = new BarcodeReader();
gScanner.BarcodeRead += new BarcodeReadEventHandler(Scanner_BarcodeRead);
gScanner.ThreadedRead(true);
}
catch (System.Exception)
{
MessageBox.Show("您的设备不支持扫描不能进行清查操作,只具有查看设备信息功能!", Common.messageCaption);
Common.exceptionFlag = "1";
}
}
}
//关闭扫描
protected void CloseScanner()
{
if (Common.exceptionFlag == "0")
{
try
{
Application.DoEvents();
if (gScanner != null)
{
gScanner.BarcodeRead -= new BarcodeReadEventHandler(Scanner_BarcodeRead);
gScanner.Dispose();
gScanner = null;
//GC.Collect();
}
}
catch (System.Exception)
{
MessageBox.Show("您的设备不支持扫描不能进行清查操作,只具有查看设备信息功能!", Common.messageCaption);
Common.exceptionFlag = "1";
}
}
}
#endregion
#region 定义Intermec扫描事件
protected void Scanner_BarcodeRead(object sender, BarcodeReadEventArgs bre)
{
string dabh = bre.strDataBuffer;
}
- c#读条码程序
- c#开发一个zebar105sl的条码打印的程序
- C#条码设计- 前言
- C#条码设计- Code39
- C#条码设计-CODE93
- C#生成商品条码
- C#条码打印
- C# Barcode 条码
- C#生成条码
- Bartender条码使用方法C#
- code128b条码生成程序
- 条码打印机编程使用方法 C#
- C# LPT操作打印条码
- C#打印二维条码QRCode
- c# 39条码的生成
- C#条码打印与ZPL
- C# BarCodeToHTML条码生成类
- C#的zxing条码工具
- ANDROID 常见错误(不断添加总结)
- C#图片格式打印
- [iPhone开发]消息通信机制NSNotificationCenter
- HTML DOM Properties and Methods
- Activity之间的数据传递
- c#读条码程序
- 从Linux到Solaris(备份恢复,故障诊断)
- C#打印条码操作的实例浅析
- try-catch-finally执行顺序探秘
- C# socket基本连接通信(二)
- [流解析 vs 2005]basic_ios
- 常用正则表达式
- 函数: 判断两个字符串是否完全一样
- C#各种类型相互转换