private void ShowInfo(BardCodeHooK.BarCodes barCode) { if (this.InvokeRequired) { this.BeginInvoke(new ShowInfoDelegate(ShowInfo), new object[] { barCode }); } else { KeyName = barCode.KeyName; VirtKey = barCode.VirtKey.ToString(); ScanCode = barCode.ScanCode.ToString(); Ascll = barCode.Ascll.ToString(); Chr = barCode.Chr.ToString(); BarCode1 = barCode.IsValid ? barCode.BarCode : BarCode1;//是否为扫描枪输入,如果为true则是 否则为键盘输入 } }
private void ShowInfo(BardCodeHooK.BarCodes barCode) { if (this.InvokeRequired) { this.BeginInvoke(new ShowInfoDelegate(ShowInfo), new object[] { barCode }); } else { textBox1.Text = barCode.KeyName; textBox2.Text = barCode.VirtKey.ToString(); textBox3.Text = barCode.ScanCode.ToString(); textBox4.Text = barCode.Ascll.ToString(); textBox5.Text = barCode.Chr.ToString(); textBoxCode.Text = barCode.IsValid ? barCode.BarCode : textBoxCode.Text;//是否为扫描枪输入,如果为true则是 否则为键盘输入 //textBox7.Text += barCode.KeyName; //MessageBox.Show(barCode.IsValid.ToString()); } }
private void BarCode_BarCodeEvent(BardCodeHooK.BarCodes barCode) { ShowInfo(barCode); }