当我刷卡时,不会触发 .net MSR DATA EVENT 的 POS
我正在开发应用程序,该应用程序将读取信用卡号,而无需在 .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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
确保您正在调用 device.Open()、device.Claim(),并将 DataEventEnabled 属性设置为 true。
Make sure you are calling device.Open(), device.Claim(), and also setting the DataEventEnabled property to true.
在事件处理程序 myMSR_DataEvent 设置结束时,
我注意到单步执行我的 DataEvent 函数,它将被设置为 false,这就成功了。
At the end of your event handler myMSR_DataEvent set
I noticed that stepping through my DataEvent function it will be set to false, and this did the trick.
嘿 Jaynesh,我正在解决类似的问题,并遇到了这个条目,希望您现在已经解决了,但是当我们遇到类似的问题时,对我们有用的是以下内容(请原谅以下是 C# 而不是 VB.NET) ):
当然,在机器的 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):
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!