Read Magnetic Card Swipe Data into VB Winform App

  • Thread starter Thread starter PvdG42
  • Start date Start date
P

PvdG42

I'm working on a charitable project for a community organization with my
Economics Prof. son, creating an application that will (hopefully) help to
teach young people about the value of work. The app is a "time bank" that
will track the time youngsters spend building and repairing recycled
bicycles. Participants can earn bicycles and/or parts through their efforts.
To teach them more about banking concepts, time "saved" will also earn
interest as would savings in an actual bank.

http://www.communitybikeworks.org/

So much for the context. Here's the real question. The plan is to issue
simple magnetic stripe cards to the participants, pre-encoded with a four
digit number. The card would be swiped to enter data about a participant's
account, keyed by the number on the swiped card. Everything about this
project is pretty simple and straightforward to me *except* the process of
actually capturing the data from a card swipe.

We plan to use a simple card reader (USB interface) that can read data from
tracks 1 and 2 of the card, although track 2 will not be used. All we need
to capture is the 4 digit number. I've read the tech stuff on several
readers, and some manufacturers offer demo programs, but information on how
one actually can detect a card swipe and capture the data in a .NET app
seems to be scarce. Here's the reader we're considering.

http://semicron.com/mini-wedge.html

I'd really appreciate any advice or experiences you might provide. TIA!
 
Hi,

I don't know anything about the reader that you are looking at, but I've had
great success with the Magtek Mini USB (see:
http://www.magtek.com/products_V2/card_readers/mini/usb/standard_configurations.asp).
Note, this comes in two versions, keyboard emulation and HID. I strongly
recommend the HID over keyboard emulation. You can acquire data from the
device without having to set focus to a textbox, or other input window, and
capturing the data from that window.

One can use keyboard emulation, which actually requires no real extra
code -- data appears just as if it was typed at the keyboard. However, if
the user inadvertently shifts focus to a window that is not setup to receive
this data, then things tend to go wrong. The HID version would allow you to
process the data from the swipe, and do whatever necessary with it... No
matter what the application user has done.

Magtek provides sample code, and I have used this reader in both VB6 and VB
..NET applications. The reader itself isn't expensive, and support all three
tracks, if necessary. BTW, I have no association with Magtek.

Dick


--
Richard Grier, Consultant, Hard & Software 12962 West Louisiana Avenue
Lakewood, CO 80228 303-986-2179 (voice) Homepage: www.hardandsoftware.net
Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004, Revised July
2006.
 
Ah, I see that your link is to Magtek readers. Still, what I said applies,
I think.

Dick

--
Richard Grier, Consultant, Hard & Software 12962 West Louisiana Avenue
Lakewood, CO 80228 303-986-2179 (voice) Homepage: www.hardandsoftware.net
Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004, Revised July
2006.
 
In addition to Dick Grier's sage advice, you may also want to have a look at
Jan Axleson's site (http://www.lvr.com/hidpage.htm#MyExampleCode) for some
source code that will allow you to access the USB HID devices with out
having to use ActiveX the solution that Magtek provides. We have been using
her code for years to interface Barcode Scanners and Mag Stripe readers to
our offerings.

Ron W
 
Hi,

Actually, the Magtek code is based on Jan's book! Naturally, they give her
full credit.

The .NET code that I have is somewhat similar, but there are differences in
approach.

Dick

--
Richard Grier, Consultant, Hard & Software 12962 West Louisiana Avenue
Lakewood, CO 80228 303-986-2179 (voice) Homepage: www.hardandsoftware.net
Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004, Revised July
2006.
 
RDub said:
In addition to Dick Grier's sage advice, you may also want to have a look
at Jan Axleson's site (http://www.lvr.com/hidpage.htm#MyExampleCode) for
some source code that will allow you to access the USB HID devices with
out having to use ActiveX the solution that Magtek provides. We have been
using her code for years to interface Barcode Scanners and Mag Stripe
readers to our offerings.

Ron W

Thank you both very much! Great information. Now, on to the business of
actually making the Time Bank work for the kids.
I took your suggestion on the reader and ordered two of the MagTek USB HID
models, one for me and one for my son. Next step, ordering some cards
encoded with 4 digit numbers...
 
PvdG42 said:
Thank you both very much! Great information. Now, on to the business of
actually making the Time Bank work for the kids.
I took your suggestion on the reader and ordered two of the MagTek USB HID
models, one for me and one for my son. Next step, ordering some cards
encoded with 4 digit numbers...
You do know that you can start testing your software using a credit card,
drivers licence, or just about anything else that has a Mag stripe on it.
Also you can purchase a card writer and blank media to create your own cards
for a few hundred bucks more.

Ron W
 
Back
Top