Click here to Skip to main content
15,940,173 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to read the value from barcode device using barcode reader
Updated 6-Apr-14 9:07am
Aarti Meswania 6-Apr-14 11:31am    
why are you adding prefix "amrapali complaints"?
just remove it...
[no name] 6-Apr-14 15:45pm    
great answer sir

good job ..
[no name] 6-Apr-14 16:38pm    
[no name] 6-Apr-14 16:41pm    
we have now problem with it
[no name] 6-Apr-14 16:41pm    
keep it up

1 solution

Generally, you don't - most act as keyboard input so you don't have to.

However, consult the manufacturer and they will give you full details.
Share this answer
Sergey Alexandrovich Kryukov 6-Apr-14 11:55am    
It's not "generally", just the opposite: this is one of the possible interfaces to such devices, called "keyboard wedge". By the way, it creates many problem: there are many questions, how to filter output from "real" keyboard from that from a scanner. (And I don't know the answer.)
OriginalGriff 6-Apr-14 12:11pm    
Most manufacturers will allow the device to generate a start and end sequence code, which lets you spot the BC data from the "real" keyboard data. Exactly how you set it varies from manufacturer to manufacturer (and sometimes model to model as well)
Sergey Alexandrovich Kryukov 6-Apr-14 12:41pm    
Do you mean "signature string" which essentially say "scanner sequence started"? This would not be a good solution, because some users might typed something in parallel... It looks like the whole idea was bad from the very beginning, driven by "let's keep it easy", which is rarely really easy... :-)
Dave Kreskowiak 6-Apr-14 13:11pm    
Not likely. You can pick character strings that are very different from what a user could type without resorting to Alt-key sequences, such as \c255 \c254 \c255. You also pick a postfix sequence to show when the data is complete and you can resume normal keyboard operation.

That's the way I've done it in the past and it works very well.

Put this stuff in the Form KeyDown event and it's really pretty easy, for us anyway. ;)

Sergey Alexandrovich Kryukov 6-Apr-14 13:42pm    
Not very likely but theoretically possible, isn't it? But you point is good: the scanner syntax can really be "non-printable". But I don't know what happens in reality...
Thank you,

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