Click to See Complete Forum and Search --> : how to post magnatic stripe card reader data to aspx or ashx?


catdance
07-16-2009, 05:13 AM
I am working on something that I have to first read the id number on a magnetic stripe card then post it to a login.aspx to login the website.
what sorts of techniques can I use for achieving that?

my first solution is (insecure)----:
save the data in a file when swipe the card, then use ActiveX control in a Javascript to read the file on clinet machine, then post it to the login.aspx

any better idea?

Kuriyama
07-20-2009, 08:07 AM
.aspx means .NET. Please ask this question in the .NET forum.

svidgen
07-20-2009, 09:34 AM
Stripe readers generally act like keyboards. The only real issue is dealing with carriages returns / newlines. The workaround can be something like a keylogging JavaScript (a Flash app or Java applet would work too). Just log the keystrokes until you hit your designated End-Of-Data marker or a pause in input significantly greater than that between "keystrokes" as configured in your reader.

EDIT: And then, of course, stuff the logged keystrokes into a variable for an AJAX request or a form field for a synchronous request [or a form field for an AJAX request].