【发布时间】:2013-01-17 12:08:09
【问题描述】:
我正在为带有 2D 阅读器的 Intermec 手持设备 CK30 开发 C# compact framework 2.0(windows mobile 6.1)。
每次我使用条形码时,我的键盘都会停止工作。任何想法为什么?
这是代码。第一部分是配置条形码阅读器的类。第二部分是使用条形码阅读器填充文本框的表单。
使用条形码阅读器读取内容后,键盘停止工作......
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Intermec.DataCollection;
namespace BarCodeReaderTest
{
class LeitorCodigoDeBarras
{
public BarcodeReader LerCodigoDeBarras()
{
try
{
BarcodeReader meuLeitor = new BarcodeReader("default", 4096);
meuLeitor.ScannerEnable = true;
meuLeitor.ThreadedRead(true);
return meuLeitor;
}
catch (BarcodeReaderException bx)
{
MessageBox.Show("Não foi possível inicializar o leitor de código de barras. Contate seu supervisor. \n" + bx.Message);
return null;
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Intermec.DataCollection;
namespace BarCodeReaderTest
{
public partial class Form1 : Form
{
public BarcodeReader leitor;
public Form1()
{
InitializeComponent();
LeitorCodigoDeBarras classeLeitor = new LeitorCodigoDeBarras();
leitor = classeLeitor.LerCodigoDeBarras();
leitor.BarcodeRead += new BarcodeReadEventHandler(this.eventoLeitorCodigoDeBarras);
}
void eventoLeitorCodigoDeBarras(object sender, BarcodeReadEventArgs e)
{
tbCodLido.Text = e.strDataBuffer;
}
}
}
【问题讨论】:
-
我从来没有听说过这样的问题,这没有逻辑意义。这真的是您测试和重现问题的代码吗?
-
是的,好心的先生。
-
使用最新固件重新刷新设备或首先尝试恢复出厂默认设置。这不是正常行为。
-
已经做到了。没有成功。我实际上正在使用 6 个相同型号的不同设备。
标签: c#-2.0 windows-mobile-6.1 intermec handhelddevice