简体   繁体   English

从ASP.NET网站呼叫USB读卡器的选项

[英]Options for calling a usb card reader from asp.net site

A project I am working on was given the task of calling an usb emv card reader from the web (Magtek DynaMag). 我正在研究的一个项目的任务是从网络上调用USB emv卡读卡器(Magtek DynaMag)。 The site I am working with is asp.net (4.5). 我正在使用的站点是asp.net(4.5)。

I realize that this can be done via java, or Silverlight (or if I was fine with an asp classic page via an active x control, however my options are limited as the only way I have to call the reader is a .dll file that was made to be consumed by a win forms device, and outside of c# I am not to familiar with other languages. I saw options about using a Windows Form Control Library online but the samples are back from 2004 – 06 and since then the technologies have changed. 我意识到可以通过Java或Silverlight来完成此操作(或者如果我通过活动的x控件使用asp经典页面也可以,但是我的选择受到限制,因为我调用读取器的唯一方法是.dll文件,是由Win Forms设备使用的,并且在c#之外我不熟悉其他语言,我看到了有关在线使用Windows Form Control库的选项,但示例可追溯到2004年6月,从那时起,这些技术就改变。

The questions I have are as follows. 我的问题如下。 1. Is a Win Form Control Lib still a viable option, and if so how do you add it to the asp site and display(code samples would be nice) 2. If not, then what are my options and how do I go about implementing this dll into the asp.net site? 1. Win Form Control Lib仍然是一个可行的选择吗,如果是的话,如何将其添加到asp站点并显示(代码示例会很好)2.如果没有,那么我的选择是什么,我该怎么做实现这个DLL到asp.net站点?

I realize that I may be limited to working with only IE (im fine with that) and as for reference; 我意识到,我可能仅限于仅使用IE(对此还可以)并作为参考; WFCL DLL name when built: MagtekWFCL.dll 生成时WFCL DLL名称: MagtekWFCL.dll

Namespace: MagtekWFCL 命名空间: MagtekWFCL

Class: BagOfHolding (it's a garbage name in the test code as its holding all my junk code) 类: BagOfHolding(在测试代码中是一个垃圾名称,因为它包含我所有的垃圾代码)

How i am attempting to add it to the aspx page currently: 我现在如何尝试将其添加到aspx页面:

<object id="TagReader" runat="server" height="476" width="428" data="MagtekWFCL.dll">
        </object>

DLL i am getting from magtek: DynaPro.NET API 我从magtek获得的DLL: DynaPro.NET API

Any help into this would be greatly appreciated. 任何帮助,将不胜感激。

I realize this question is a year old but I just ran into this problem myself. 我知道这个问题已经一岁了,但我本人只是遇到了这个问题。 Magtek has a new project based on WPF/C# with updated documentation and new libraries for interfacing a reader through WPF, Winforms, or ASP.Net. Magtek有一个基于WPF / C#的新项目,具有更新的文档和新的库,可通过WPF,Winforms或ASP.Net与阅读器接口。 https://www.magtek.com/Content/SoftwarePackages/99510132.zip https://www.magtek.com/Content/SoftwarePackages/99510132.zip

Add the four DLL's to your project: MTDevice.dll, MTLIB.dll, MTSCRANET.dll, MTService.dll and a reference to them as well, then add these using statements: 将四个DLL添加到您的项目中:MTDevice.dll,MTLIB.dll,MTSCRANET.dll,MTService.dll以及对它们的引用,然后使用以下语句添加它们:

using MTLIB;
using MTSCRANET;

and then a reference field: 然后是参考字段:

private MTSCRA _SwipeScanner;

You can then access the reader like this: 然后,您可以像这样访问阅读器:

    _SwipeScanner = new MTSCRA();
    _SwipeScanner.setConnectionType(MTConnectionType.USB);
    _SwipeScanner.openDevice();

You will then need to create events for when a card is swiped, card data changed, connection status changed, etc. 然后,您需要为刷卡,更改卡数据,更改连接状态等创建事件。

Also I found calling Magtek's customer service was pretty easy as well. 我还发现给Magtek的客户服务打电话也很容易。 I had to leave a message but they called me back within a couple hours. 我不得不留言,但他们在几个小时内给我回了电话。 I doubt this will help you due to the age of the question, but hopefully it will help others. 我怀疑这会因问题的年代而对您有所帮助,但希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM