I de开发者_运维知识库veloped the billing project. I going to implement the card swipe reader. I have no idea about the card swipe reader application with VB + winforms
Can some one help me !!
Give samples and tutorials etc...
A lot of this really depends on your card reader.
There are generally speaking two kinds of card readers, ones that emulate HID and ones that communicate via a COM interface. There are some that do both, though not at the same time.
If your card reader has keyboard emulation, then nothing special needs to be done - the card reader will automatically output the data to the textbox that has the focus.
If your card reader uses HID (Human Interface Device), then you will need to look into using serial communications and need to reference the Mfg. of your card reader for the commands to use. Take a look at this (http://msdn.microsoft.com/en-us/library/7x7cdt5c.aspx) for some basics on serial port usage.
I also noticed "credit-card" was tagged on your question. I don't know much about writing an app designed to capture and use that data - but read up on the laws regarding using and storing this data. A good place to start is https://www.pcisecuritystandards.org/security_standards/.
Just get the device and few cards in hand first.
Step A. Identify the reader type
If it has usb cord. Connect it to pc
- Start notepad.
- Swipe the card.
- If data received goto step B
If data is not received by above step.
- Unplug the device.
- Start device manager.
- Expand the Ports node.
- Note the port numbers.
- Plug device.
- A comport would get added.
- Open Start-accessories-communications-hyperterminal
- Open this port in hyper terminal.
- Swipe card. If no data or garble data is received, change the baud rate and try again.
- If legible data is received goto step B
Step B.
Try to match the data received with the swipe card number.
If it matches, you are through.
Else try to study the pattern. It might be an hex string.
Step C.
If the data is received in notepad (HID Device) then its simple, just add the add a texbox on form and set focus to it. When card is swiped the data number will be shown in textbox.
If data is received in Hyper terminal(Comm/Serail reader). Then you have to add a serial port reader and read and parse data accordingly.
***Pls provide the sample card number and string received in above step we will try to parse it.
There really doesn't seem to be a lot of information out there about this topic. Check out this thread on the MSDN forums, it and the link provided inside might be useful to you. One common theme I found while browsing through some posts, and something that's just generally true when using third-party hardware with your app, is to contact the manufacturer of the swipe reader and get documentation from them, as they'll most likely have all that information on file. Good luck!
Going WAYYY back for me, when dealing with credit card readers, there was nothing to it... it was basically a keyboard wedge device... I have similar device for reading barcodes with a hand scanner connected to USB port.
To test, just open up a document, such as in notepad. Connect the device (such as USB connected scanner), and swipe the card... if the text is just shoved through as if a keyboard scan, just have a data entry field capture the text to its full length (such as 100 characters) then parse it.
精彩评论