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;
相关文章:
-
2022-12-23
-
2021-05-18
-
2021-12-11
-
2022-12-23
-
2021-12-31
-
2021-07-05
-
2022-02-08
猜你喜欢
-
2021-05-19
-
2022-02-14
-
2021-12-29
-
2021-07-10
-
2022-01-12
相关资源
-
下载
2021-06-23
-
下载
2021-06-07
-
下载
2023-01-23
-
下载
2021-06-06