How to work with a Smart Card

12,979

Solution 1

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.

Solution 2

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.

Solution 3

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.

Share:
12,979
7heViking
Author by

7heViking

Updated on August 22, 2022

Comments

  • 7heViking
    7heViking almost 2 years

    My project I am working on a small program which has to set an alarm if the user locks the computer without removing the Smart Card from the computer.

    I am using C# with WPF and .Net 4.0 and my smartcard is version V4.2C

    My problem I have all the functionality to work but I simply don't know how to detect if the Smart Card is in the Smart Card Reader.

    I have tried to search on google but with no result so I hope some of you can help me.