|
private Symbol.Barcode.Reader MyReader = null;
private Symbol.Barcode.ReaderData MyReaderData = null;
private void Form1_Load(object sender, System.EventArgs e)
{
MyReader = new Symbol.Barcode.Reader();
MyReaderData =
new Symbol.Barcode.ReaderData(Symbol.Barcode.ReaderDataTypes.Text,
Symbol.Barcode.ReaderDataLengths.DefaultText);
MyReader.ReadNotify += new EventHandler(MyReader_ReadNotify);
MyReader.Actions.Enable();
MyReader.Actions.Read (MyReaderData);
return;
}
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs
e)
{
MyReader.Actions.Flush();
MyReader.Actions.Disable();
MyReader.Dispose();
MyReaderData.Dispose();
return;
}
private void MyReader_ReadNotify(object sender, EventArgs e)
{
System.Windows.Forms.MessageBox.Show(MyReaderData.Text, "HelloScan");
MyReader.Actions.Read(MyReaderData);
return;
}
这个是Developer Guide for Symbol Devices上面的代码 |
|