I need to be able to read a 2D barcode using a standard USB 2D barcode reader. We're trying to do this in an ASP.NET 2.0 web page, using the standard textbox, and the problem I have is the mangling of special characters, especially CR / LF.
Th开发者_StackOverflow中文版e first few characters of the string should be "@", 0x0A (LF), 0x1C, 0x0D (CR), followed by more normal text records delimited by 0x0A (LF). The very end of the scan ends with 0x0D (CR).
So the results would look like this
@ 0x0A
0x1C 0x0D
record1 0x0A
record2 0x0A
record3 0x0A
0x0D
When I try to scan this into my textbox, it gets "@", then it starts interpreting everything else as browser commands, and IE and firefox both do very interesting things.
If this was a winforms app, I would put a special control there to read the keystrokes and put them all together in a buffer. Is there any way to do this in a browser app, to get the special characters read in correctly, and without re-interpreting the end of line characters?
精彩评论