Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read data from Bar Code Scanner in .net (C#) windows application! [closed]

Tags:

c#

barcode

How to read data from Bar Code Scanner in .net windows application?

Can some one give the sequence of steps to be followed? I am very new to that.

like image 265
Dhanapal Avatar asked Feb 06 '09 10:02

Dhanapal


People also ask

Can we get data from barcode?

The purpose of a barcode scanner is to scan or read a barcode symbol and then provide an electrical output to a computer via a decoder and cable. The decoder recognizes the type of barcode symbology it is seeing, translates the bar and space content and transmits data to a computer in a human readable format.

How do I tell if keyboard input is coming from a barcode scanner?

In order to use the Barcodescanner Keyboard you need to enable it. Do this by opening Android Settings , Language & keyboard and enable the input method named Barcode Keyboard by checking the box. Confirm the security warning (see privacy). After the input method was enabled it must be activated.


2 Answers

Look at the scanner jack.

If it looks like this:

, then it's a keyboard wedge scanner. It acts like a keyboard: just types your barcode into an edit field.

If it looks like this:

, it's a serial port scanner.

You need to create an instance of System.IO.Ports.SerialPort and use it to communicate with the scanner.

If it looks like this:


(source: datapro.net)

, it's a USB scanner. From programmer's point of view, it can be either a keyboard wedge or a serial port scanner. You need to look at the manual, find out which is it and use one of the approaches above.

P.S. It will be easier if you post your scanner's model here, really.

like image 82
Quassnoi Avatar answered Oct 13 '22 06:10

Quassnoi


I now use the Wasp USB WCS3905 barcode scanners attached to several of my winform (and 1 console) applications although have not noticed differences with other brands of USB scanner.

The way I always test when a new one comes along is to fire up notepad and scan a load of codes off everything that comes to hand; books, DVD, asset tags, but most importantly the stock I need to track. This will allow you visualise how the data is captured.

In my experience they all act like a user typing each character succesively on a keyboard followed by an "Enter" keypress.

For each character (NOTE: not complete bar-code) scanned in a textbox control then at least following events fire:
KeyDown
KeyPress
TextChanged
KeyUp

The Enter keystroke at the end of a scan can be used to push a form's AcceptButton

It should probably be noted that I've only used these on UK-English & US-English configured windows systems.

G-

like image 42
G-. Avatar answered Oct 13 '22 08:10

G-.