Hi
There are many different types of barcode scanners. USB and PS2 are the
most common.
I have experience with PS2 scanners. Essentially they plug in to your
PS2 keyboard port and act like any other keyboard device. When a
barcode is scanned, it sends the characters through as if they were
typed on a keyboard. So for example, if your win form has a textbox
that has the focus, and you scan a barcode, the characters appear in
the textbox.
To program against this, the best way is to handle the keypress events
native to a windows form or any other control. Usually a barcode will
need to have a * at the front and back for the barcode scanner to pick
it up, but this can be configured on most scanners as well. The * will
be removed by the time it gets to your app so you don't need to account
for it.
Essnetially you can differentiate from the barcode scanned text and the
keyboard typed text by checking the speed in which the characters come
in. If they come in super fast, then most likely those chars were
scanned, if they come in slower, then they were typed.
You also need to consider what barcode font to use, and then ensure
your barcode scanner supports that font. There are a few common ones,
but its best to use one that supports alpha and numeric chars. You can
get very cheap Code39 scanners and the font is freely available on teh
web to download
Hope this helps.
Steven Nagy