USB Card Reader
-
What the hell are you smoking?? FileSystemWatcher to deal with a keyboard-based card reader??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Hi, How does one go about, catching the events of a USB card reader... Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers). How do I go about obtaining the data event, where the data is written? How can I obtain the data written via a simple C# application. Does anyone understand my question. If vague, plz ask. Any help or starting point (documentation) would be much appreciated. Kinds regards, Higs
If you're seeing the data in Notepad, this mean the card reader is acting like a keyboard. It'll type whatever the card contents are into whatever control has the focus.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
What the hell are you smoking?? FileSystemWatcher to deal with a keyboard-based card reader??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers).
He can access the data as if it were a file. I didn't see a reference to the keyboard-based interface :)
Dave Kreskowiak wrote:
What the hell are you smoking??
Usually, or just right now? :suss:
I are troll :)
-
Hi, How does one go about, catching the events of a USB card reader... Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers). How do I go about obtaining the data event, where the data is written? How can I obtain the data written via a simple C# application. Does anyone understand my question. If vague, plz ask. Any help or starting point (documentation) would be much appreciated. Kinds regards, Higs
It sounds as though you are trying to do the same thing[^] I am. Using the generic HID reader from this page[^], and feeding it the vendor id and product id (which can be found in device manger), I get "The device is a system keyboard. Windows 2000 and Windows XP obtain exclusive access to Input and Output reports for this[sic] devices. Applications can access Feature reports only." Which, frankly, is a bit of a blow. Maybe there is another possible approach?
-
It sounds as though you are trying to do the same thing[^] I am. Using the generic HID reader from this page[^], and feeding it the vendor id and product id (which can be found in device manger), I get "The device is a system keyboard. Windows 2000 and Windows XP obtain exclusive access to Input and Output reports for this[sic] devices. Applications can access Feature reports only." Which, frankly, is a bit of a blow. Maybe there is another possible approach?
-
Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers).
He can access the data as if it were a file. I didn't see a reference to the keyboard-based interface :)
Dave Kreskowiak wrote:
What the hell are you smoking??
Usually, or just right now? :suss:
I are troll :)
Eddy Vluggen wrote:
Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers). He can access the data as if it were a file.
Really? What file?? These things don't write to files. Neither do barcode scanners, laser scanners, or anything else. Since these devices do not know anything about file systems or Windows or UNIX or Linux or MacOS, there's really no way for them to write to files.
Eddy Vluggen wrote:
I didn't see a reference to the keyboard-based interface
The only way anything can show up in Note like he described is if the device worked like a keyboard.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Most card readers / scanners operate as a keyboard simply typing the read information onto the control / window that has focus. Check the API of your card reader, surely the vendor released some information.
Thank you very much .... I suppose I will abuse the fact that it works like a keyboard... with the same events, etc. This fact works well for me ! Thanks for your help !
-
Eddy Vluggen wrote:
Currently, when I open notepad and swipe a card, the information on the card is printed automatically in plain text.(Windows installed standard drivers). He can access the data as if it were a file.
Really? What file?? These things don't write to files. Neither do barcode scanners, laser scanners, or anything else. Since these devices do not know anything about file systems or Windows or UNIX or Linux or MacOS, there's really no way for them to write to files.
Eddy Vluggen wrote:
I didn't see a reference to the keyboard-based interface
The only way anything can show up in Note like he described is if the device worked like a keyboard.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Yes you can ... this works brilliantly !
-
Thank you very much .... I suppose I will abuse the fact that it works like a keyboard... with the same events, etc. This fact works well for me ! Thanks for your help !
OK, so what I basically did was to abuse the fact that the card reader functions like a keyboard. I basically obtain all the devices on the computer and display them the the user. The user can then select which device is the card reader. I intercept all the messages coming from the card reader then, and set focus to the correct text box (etc) as required. A nice little thingy that I saw was, that most magnetic stripe cards end with the "return" character. So when it hits the last character, I can simply test for a return (enter), and it will fire off events that obtain my required data from the database... Thanks for all the help ! MUCH appreciated ! :) PS: For help, email me or send me a msg, I'll gladly help.