Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Magnetic card reader + ActiveX DLL + connect to client

Status
Not open for further replies.

Peace2u

Programmer
Mar 5, 2006
9
DE
Hi Everybody,

I wrote an ActiveX DLL that connects to a magnetic card reader over the usb port. The ActiveX DLL works fine if the magnetic card reader is connected to the webserver, but what I would like it to do, is that a client connects to the page over the internet and when he presses on a button, it should read his usb port and not the webserver usb port. I always get the message that the device is not connected. If I connect the card reader to the webserver, everything works fine.

Thanks for the help.

/Peace2u
 
did u pass on your ActiveX DLL to all the client machines??

-DNG
 
Yes we do.

<%
Set MyCardreader = Server.CreateObject("Cardreader.ReadCard")
ActionID = Request.QueryString("ActionID")
if ActionID = "" then
ActionID = "New"
end if
if ActionID = "New" then
%>
Bitte Klicken Sie den Button um Ihre Karte einzulesen.<br>
Info: Sie haben 10 sekunden um die karte durch das lesegerät zu schieben.
<form Action="Default.asp?ActionID=OK" method="Post">
<INPUT type="submit" value="Karte einlesen" id=button1 name=button1>
</form>
<%end if%>
<% if ActionID = "OK" then %>
<table border="0" cellpadding=0 cellspacing=0>
<tr>
<td>
SchliessanlageNr:
</td>
<td>
<% = MyCardreader.ReadCardData(150,10000) %>
</td>
</tr>
</table>
<%end if%>
 
Yes we do.
This my code.

Thanky you

<%
Set MyCardreader = Server.CreateObject("Cardreader.ReadCard")
ActionID = Request.QueryString("ActionID")
if ActionID = "" then
ActionID = "New"
end if
if ActionID = "New" then
%>
Bitte Klicken Sie den Button um Ihre Karte einzulesen.<br>
Info: Sie haben 10 sekunden um die karte durch das lesegerät zu schieben.
<form Action="Default.asp?ActionID=OK" method="Post">
<INPUT type="submit" value="Karte einlesen" id=button1 name=button1>
</form>
<%end if%>
<% if ActionID = "OK" then %>
<table border="0" cellpadding=0 cellspacing=0>
<tr>
<td>
SchliessanlageNr:
</td>
<td>
<% = MyCardreader.ReadCardData(150,10000) %>
</td>
</tr>
</table>
<%end if%>
 
<%@ Language=VBScript %>
<HTML>
<HEAD>
<title>Read Card</title>
</HEAD>
<BODY>
<%
Set MyCardreader = Server.CreateObject("Cardreader.ReadCard")
ActionID = Request.QueryString("ActionID")
if ActionID = "" then
ActionID = "New"
end if
if ActionID = "New" then
Dim MyBaudrate
MyBaudrate = MyCardReader.GetDeviceBaudrate(1)
%>
Bitte Klicken Sie den Button um Ihre Karte einzulesen.<br>
Info: Sie haben 10 sekunden um die karte durch das lesegerät zu schieben.
<form Action="Default.asp?ActionID=OK" method="Post">
<INPUT type="submit" value="Karte einlesen" id=button1 name=button1>
</form>
<%end if%>
<% if ActionID = "OK" then %>
<table border="0" cellpadding=0 cellspacing=0>
<tr>
<td>
SchliessanlageNr:
</td>
<td>
<% = MyCardreader.ReadCardData(150,10000) %>
</td>
</tr>
</table>
<%end if%>
</BODY>
</HTML>
 
Sorry for spaming,

My internet explorer did not refresh the page correctly, that is why I thought it didn't accept the post.

Sorry.
 
The problem is that your trying to instantiate the DLL on the server when the device is actually connected to the client. You will need to use client-side scripting to create the object on the client-side browser and execute any methods needed.

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top