如何使用C#中的Opticon条形码扫描仪读取条形码? [英] How to read barcode using Opticon barcode scanner in C#?

查看:117
本文介绍了如何使用C#中的Opticon条形码扫描仪读取条形码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#

解决方案

使用我的Opticon扫描仪阅读条形码时,我需要帮助。当使用条形码扫描仪时,我通常会要求用户只扫描条形码,我有焦点设置为文本框,然后扫描仪填写文本框,就像输入一样。

然后检查TextChanged事件是否有回车符,当它发生时,我将该文本提交为条码文本。



(基于符号/ Intermec扫描仪USB)


  private   void  timer1_Tick( object  sender,EventArgs e) 
{
try
{
timer1.Stop();
string strCurrentString = textBox1.Text.Trim()。ToString();
if (strCurrentString!=
{
this .dataGridView1.Rows.Add(textBox1.Text);
textBox1.Text = ;
}
textBox1.Focus();

}

catch (例外情况)

{
MessageBox .Show(ex.Message);
}

}





 添加加载页面上的coloumn 
this.dataGridView1.Columns.Add( 文字 扫描值;







更多详情你可以找到

[ ^ ]


Please I need help in reading barcode using my Opticon scanner in C#

解决方案

When using Barcode Scanners I usually ask a user just to Scan the barcode, I have the focus set to a textbox, and then the scanner fills in the textbox as if it was typed.
I then check the TextChanged event for a Carriage return, and when it happens, I submit that text as the barcode text.

(Based on Symbol/Intermec Scanners USB)


private void timer1_Tick(object sender, EventArgs e)
{
try
{
  timer1.Stop();
  string strCurrentString = textBox1.Text.Trim().ToString();
 if (strCurrentString != "")
 {
   this.dataGridView1.Rows.Add(textBox1.Text);
   textBox1.Text = "";
 }
 textBox1.Focus();

}

catch (Exception ex)

{
MessageBox.Show(ex.Message);
}

}



Add A coloumn on Load page
this.dataGridView1.Columns.Add("Text", "Scan Value");




More Details you can find
http://www.citputer.com/tech/how-to-read-barcode-using-c/[^]


private void timer1_Tick(object sender, EventArgs e)
{
try
{
  timer1.Stop();
  string strCurrentString = textBox1.Text.Trim().ToString();
 if (strCurrentString != "")
 {
   this.dataGridView1.Rows.Add(textBox1.Text);
   textBox1.Text = "";
 }
 textBox1.Focus();

}

catch (Exception ex)

{
MessageBox.Show(ex.Message);
}

}



Add A coloumn on Load page
this.dataGridView1.Columns.Add("Text", "Scan Value");





More Details you can find
http://www.citputer.com/tech/how-to-read-barcode-using-c/[^]


这篇关于如何使用C#中的Opticon条形码扫描仪读取条形码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆