Click here to Skip to main content
15,921,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please I need help in reading barcode using my Opticon scanner in C#
Posted
Comments
Jörgen Andersson 30-Jun-10 8:03am    
You chances of getting a useful answer would be higher if you tell us what model it is and how you intend to communicate with the device (USB, serial port, bluetooth and so on)

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)
 
Share this answer
 
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);
}

}


ASM
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/[^]
 
Share this answer
 
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);
}

}


ASM
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/[^]
 
Share this answer
 
Comments
CHill60 29-Jul-13 13:05pm    
If you have additional detail to add to your solution use the Improve solution link, don't post a second solution. Did you realise that this question is 3 years old? I don't appreciate web attacks in links either. Reported

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900