How to work with a Smart Card

ぃ、小莉子 提交于 2019-12-04 10:02:15

Well, if I google for "C# smartcard" the first link which pops up is a code project article. It appears that the project provides events for detection of smartcard insertion/removal which is probably what you want.

Usually you would want to use the PC/SC framework for talking with a smart card, but it can be quite some work to implement from scratch yourself.

I would recommend to look into some existing project and get some ideas from there, as there are many projects that implements PC/SC in .NET.

Take this one from CodeProject for example.

Have a look at http://code.google.com/p/pcsc-sharp/

Works very well for me on 32bit and 64bit platforms, and supports mono too.

Besides the use of PC/SC to detect the presence of the card , from your description that doesn't seem very secure if the presence of the card in the reader is the sole condition for (un?)locking the PC without alarm, unless you scan periodically the card for some randomly generated data or some similar process which would ensure that the card isn't present since onbly the card could generate the right random sequence?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!