当我刷卡时,不会触发 .net MSR DATA EVENT 的 POS

发布于 2024-12-09 09:03:27 字数 522 浏览 0 评论 0原文

我正在开发应用程序,该应用程序将读取信用卡号,而无需在 .net 的 POS 中生成相同的击键。 我可以启用设备,但是当我刷卡时,MSR_Dataevent 不会触发。

编辑:我已经完成了以下代码:

myMSR = myExplorer.CreateInstance(MsrDevice)
myMSR.Open()
myMSR.Claim(60000)
myMSR.AutoDisable = True
myMSR.DecodeData = True
myMSR.TransmitSentinels = False
myMSR.DataEventEnabled = True
myMSR.DeviceEnabled = True
RemoveHandler myMSR.DataEvent, AddressOf myMSR_DataEvent
AddHandler myMSR.DataEvent, AddressOf myMSR_DataEvent
AddHandler myMSR.ErrorEvent, AddressOf myMSR_ErrorEvent

I am developing application which will read credit card no without generating keystrokes for same in POS for .net.
I can enable device but when I swipe a card MSR_Dataevent is not firing.

EDIT: I have done below code:

myMSR = myExplorer.CreateInstance(MsrDevice)
myMSR.Open()
myMSR.Claim(60000)
myMSR.AutoDisable = True
myMSR.DecodeData = True
myMSR.TransmitSentinels = False
myMSR.DataEventEnabled = True
myMSR.DeviceEnabled = True
RemoveHandler myMSR.DataEvent, AddressOf myMSR_DataEvent
AddHandler myMSR.DataEvent, AddressOf myMSR_DataEvent
AddHandler myMSR.ErrorEvent, AddressOf myMSR_ErrorEvent

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

神回复 2024-12-16 09:03:27

确保您正在调用 device.Open()、device.Claim(),并将 DataEventEnabled 属性设置为 true。

        With Me.msrDevice
            .Open()
            .Claim(5000)

            .AutoDisable = True
            .DecodeData = True
            .TransmitSentinels = False
            .DataEventEnabled = True
            .DeviceEnabled = True

            AddHandler .DataEvent, AddressOf MSR_DataEvent
            AddHandler .ErrorEvent, AddressOf MSR_ErrorEvent
        End With

Make sure you are calling device.Open(), device.Claim(), and also setting the DataEventEnabled property to true.

        With Me.msrDevice
            .Open()
            .Claim(5000)

            .AutoDisable = True
            .DecodeData = True
            .TransmitSentinels = False
            .DataEventEnabled = True
            .DeviceEnabled = True

            AddHandler .DataEvent, AddressOf MSR_DataEvent
            AddHandler .ErrorEvent, AddressOf MSR_ErrorEvent
        End With
莫相离 2024-12-16 09:03:27

在事件处理程序 myMSR_DataEvent 设置结束时,

myMSR.DataEventEnabled = True

我注意到单步执行我的 DataEvent 函数,它将被设置为 false,这就成功了。

At the end of your event handler myMSR_DataEvent set

myMSR.DataEventEnabled = True

I noticed that stepping through my DataEvent function it will be set to false, and this did the trick.

断桥再见 2024-12-16 09:03:27

嘿 Jaynesh,我正在解决类似的问题,并遇到了这个条目,希望您现在已经解决了,但是当我们遇到类似的问题时,对我们有用的是以下内容(请原谅以下是 C# 而不是 VB.NET) ):

var deviceInfo = this.PosExplorer.GetDevice(DeviceType.Scanner, deviceLogicalName);
this.device = (Scanner)this.PosExplorer.CreateInstance(deviceInfo);
this.device.Open();
this.device.Claim(1000);
this.device.DeviceEnabled = true;
this.device.DataEventEnabled = true;
this.device.DecodeData = true;
this.device.DataEvent += this.DeviceScanEvent;
this.device.ErrorEvent += this.DeviceErrorEvent;

当然,在机器的 POS.NET 服务对象配置中正确配置了 MSR(作为扫描仪),并且您为设备指定的逻辑名称正在代码示例中的“deviceLogicalName”变量中传递到此代码中。

我们将 MSR 转换为扫描仪 POS.NET 服务对象类型,这对我们有用,因为 MSR 刷卡事件只是一个“扫描”,这也使我们能够创建一个通用基类,该基类具有两者的许多通用功能我们的应用程序中使用了扫描仪和 MSR。

我希望它对您有所帮助,或者给下一个人提供另一种尝试!

Hey Jaynesh I was working through a similar problem and came across this entry, hopefully you've sorted it out by now, but what worked for us when we had a similar issue was the following (please forgive the following is C# not VB.NET):

var deviceInfo = this.PosExplorer.GetDevice(DeviceType.Scanner, deviceLogicalName);
this.device = (Scanner)this.PosExplorer.CreateInstance(deviceInfo);
this.device.Open();
this.device.Claim(1000);
this.device.DeviceEnabled = true;
this.device.DataEventEnabled = true;
this.device.DecodeData = true;
this.device.DataEvent += this.DeviceScanEvent;
this.device.ErrorEvent += this.DeviceErrorEvent;

Of course the MSR was configured properly (as a Scanner) in the POS.NET Service Object configuration for the machine and the Logical Name you specified for the device is being passed into this code in the "deviceLogicalName" variable in the code sample.

We cast the MSR as a Scanner POS.NET Service Object type and that worked for us as the MSR swipe event is just a "scan", this also allowed us to make a generic base class that had a lot of the common functionality for both the scanners and MSR's being used in our app.

I hope it helps you, or gives the next guy another thing to try!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文