We are using bar code scanners in our application to scan bar codes. Generally, when the ISBN bar code is scanned it return the following bunch of keys when scanning ISBN: 97887021006268
- LeftCtrl
- B
- LeftShift
- M
- D9
- D7
- D8
- D8
- D7
- D0
- D2
- D1
- D0
- D6
- D2
- D6
- D8
- LeftCtrl
- C
LeftCtrl+B combination is the preamble and tells us that it we are starting to read identifying number. LeftCtrl+C combination is the postamble and tells us that we are finishing to read identifying number. LeftShift+M combination tells us that we read barcode type. Based on that information, after scanning bar code I can automatically search for book with the related ISBN. We are using our own bar code reader library where we can recognize ISBN, Code39 and I2Of5.
Now, our client both new bar code scanners that are the keyboard scanners. After scanning the same ISBN, we can see that it does not contains, preamble, and postamble, as good as code for returning barcode type. Instead we got only numbers and Return key at the end:
- D9
- D7
- D8
- D8
- D7
- D0
- D2
- D1
- D0
- D6
- D2
- D6
- D8
- Return
In such case I cannot automatically recognize what is the type of bar code and even recognize whether it was bar code scanned - for instance I cannot automatically search for To resolve the problem I am thinking about the user control where user with:
- TextBox to which will be identifying number scanned
- RadioButton with options (ISBN, Code39, I2Of5)
- Button responsible for further processing based on selected RadioButton option an value in TextBox and
I would like to ask whether there is other (better) solution.