捉从磁卡读取器输入到可变 [英] catch input from a magnetic card reader to a variable

查看:101
本文介绍了捉从磁卡读取器输入到可变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法找到一个办法赶上磁卡读写器的输入端。当刷卡,输入进入活跃文本编辑器,好比说一个记事本。

I can't seem to find a way to catch the input of a magnetic card reader. When it swipes, the input gets into active text editor, like say a notepad.

可惜的是,注重文本字段不会做的伎俩,因为我需要使它成为一个标签,而不是一个文本框。因此,我需要一种方法来从USB设备的输入赶上变量或标签来代替。

Unfortunately, the focus on textbox field won't do the trick, because I'm required to make it a label instead of a textbox. Thus, I need a way to catch the input from the USB device to a variable or label instead.

请问我可以用它来做到这一点的.NET类的人知道或者更好的想法?

Does anyone knows of a .NET class I could use to do this or any better ideas?

推荐答案

我不认为会有反正你以防止手工输入用户。我怀疑你有读卡器模拟键盘。所以,为了能够从阅读器阅读,则必须接收键盘输入和键盘输入是指用户可以键入任何他们喜欢的。

I don't think there will be anyway for you to prevent the user from manual input. I suspect the card reader that you have emulates a keyboard. So, to be able to read from the reader, you must receive keyboard input, and keyboard input means the user can type anything they like.

一个可能的解决办法是改变您读卡器一个使用API​​从卡片阅读。

A possible solution is to change your card reader to one that uses an API to read from cards.

如果得到一个更好的读卡器是不是一种选择,我认为最好的方法来做到这一点有一个按钮。当点击该按钮,打开包含@Bala - [R提供的代码的新形式。但除此之外,从第一键输入关闭1秒内的形式。这将防止用户手动篡改输入,但会提供足够的时间为读者完成

If getting a better card reader isn't an option, I think the best method to do this is to have a button. When the button is clicked, open a new form that contains the code @Bala R provided. But in addition, close the form within 1 second from the first key input. This will prevent users from tampering the input manually, but will provide sufficient time for the reader to complete.

这篇关于捉从磁卡读取器输入到可变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆