Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. C# contactless smart cards

C# contactless smart cards

Scheduled Pinned Locked Moved C#
helpcsharpalgorithmsjsonquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hristiyan
    wrote on last edited by
    #1

    Hello there. I'm developing a C# application that interracts with a contactless smart card readers ( MiFare 1k and MiFare 2k readers), but since those kind of card readers dont support PS/SC the WinScard API won't help. (For a start ... i need a list of all connected contactless smart card readers ) So i suppose i should loop through all connected usb devices and send some APDU command so they can give their status ( identify them if they are contactless smart card readers ) Is that the right way to do that ? If someone has any information about this issue ... i'm opened to any suggestions I've been searching around the web for about 3 whole days and i'm nowhere .... Please help me

    D 1 Reply Last reply
    0
    • H Hristiyan

      Hello there. I'm developing a C# application that interracts with a contactless smart card readers ( MiFare 1k and MiFare 2k readers), but since those kind of card readers dont support PS/SC the WinScard API won't help. (For a start ... i need a list of all connected contactless smart card readers ) So i suppose i should loop through all connected usb devices and send some APDU command so they can give their status ( identify them if they are contactless smart card readers ) Is that the right way to do that ? If someone has any information about this issue ... i'm opened to any suggestions I've been searching around the web for about 3 whole days and i'm nowhere .... Please help me

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You'd normally go to the manufacturer and get the Software Development Kit to do this. I can't believe a manufacturer put out a piece of hardware and didn't supply an SDK so you can use it in your own code.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      H 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You'd normally go to the manufacturer and get the Software Development Kit to do this. I can't believe a manufacturer put out a piece of hardware and didn't supply an SDK so you can use it in your own code.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        H Offline
        H Offline
        Hristiyan
        wrote on last edited by
        #3

        Thank you for your response. Unfortunatly my task is to develope an access management system that interracts with all card readers in a specific building. And unfortunately the card readers in that building are not from the same manifacturer. ( The only thing in common between them is that they are conctactless card readers and reader MiFare 1k and MiFare 2k cards. ) Yes, i have a sdk which works fine with the specific reader provided to me, but ... i dont think it will "work" with the other devices. So I was thinking of a universal low level usb communication with the card readers, hoping they "work the same way behind the scenes". And folowing that logic i got stuck here http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=2906409&tid=2904097[^]

        modified on Monday, February 2, 2009 3:37 AM

        D 1 Reply Last reply
        0
        • H Hristiyan

          Thank you for your response. Unfortunatly my task is to develope an access management system that interracts with all card readers in a specific building. And unfortunately the card readers in that building are not from the same manifacturer. ( The only thing in common between them is that they are conctactless card readers and reader MiFare 1k and MiFare 2k cards. ) Yes, i have a sdk which works fine with the specific reader provided to me, but ... i dont think it will "work" with the other devices. So I was thinking of a universal low level usb communication with the card readers, hoping they "work the same way behind the scenes". And folowing that logic i got stuck here http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=2906409&tid=2904097[^]

          modified on Monday, February 2, 2009 3:37 AM

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Well, unfortunately for you, the commands, responses, and communication protocol between the different card readers are, more-than-likely, not the same. You're going to end up writing a seperate communication module for each card reader you have. The SDK for each of them is the only thing that's going to simplify this process.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          H 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Well, unfortunately for you, the commands, responses, and communication protocol between the different card readers are, more-than-likely, not the same. You're going to end up writing a seperate communication module for each card reader you have. The SDK for each of them is the only thing that's going to simplify this process.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            H Offline
            H Offline
            Hristiyan
            wrote on last edited by
            #5

            Thank you for your response! I was afraid , but not surpsised by your answer. Since those devices don't support PS/SC, there is no universal way to achieve my goal. However when i pass this hell, i'm going to write an article about contactless cards and contactless card readers i codeproject (actually ... as surprising as it sounds ... there is not even one GOOD article about that in the web - i've been researching like a whole week ) Thanks again for the information ! Best regards, Hristiyan ....

            K 1 Reply Last reply
            0
            • H Hristiyan

              Thank you for your response! I was afraid , but not surpsised by your answer. Since those devices don't support PS/SC, there is no universal way to achieve my goal. However when i pass this hell, i'm going to write an article about contactless cards and contactless card readers i codeproject (actually ... as surprising as it sounds ... there is not even one GOOD article about that in the web - i've been researching like a whole week ) Thanks again for the information ! Best regards, Hristiyan ....

              K Offline
              K Offline
              Ken Bodnar
              wrote on last edited by
              #6

              I have been through this hell, and it is possible to write a program that will process a couple of different cards. However, I have done it with C++ and not C#. I will try to give you an idea of how to do this in C#. What I did, was that I had a Mifare and a 15693 contactless mix. The readers were made by entirely different companies. Each reader has its own dll and there is unmanaged code to and from the reader, so in C# you must use delegates for you methods. You must also add the references (dlls to the project). Then you create a reader object for every kind of reader that you have dlls for. I had a dll which was able to read and code to differentiate the various RFID technologies, and using that bit of code snippet, I was able to determine what dlls and reader objects to use. The SDKs were fairly expensive, but I can give you a C++ code snippet on how to determine the various technologies: (you will notice that this can determine 1so15693, 14443A, 14443B, iso8000, felica

              /////////////////////////////////////////////////////////////////////////////
              // CIso_benchDlg dialog

              CIso_benchDlg::CIso_benchDlg(CWnd* pParent /*=NULL*/)
              : CDialog(CIso_benchDlg::IDD, pParent)
              {
              //{{AFX_DATA_INIT(CIso_benchDlg)
              m_tagid = _T("");
              m_type = _T("");
              m_iso15693 = FALSE;
              m_iso14443A = FALSE;
              m_iso14443B = FALSE;
              m_iso18000 = FALSE;
              m_felica = FALSE;
              //}}AFX_DATA_INIT
              // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
              m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
              }

              void CIso_benchDlg::DoDataExchange(CDataExchange* pDX)
              {
              CDialog::DoDataExchange(pDX);
              //{{AFX_DATA_MAP(CIso_benchDlg)
              DDX_Control(pDX, IDC_DETECT, m_button);
              DDX_Text(pDX, IDC_TAGID, m_tagid);
              DDX_Text(pDX, IDC_TYPE, m_type);
              DDX_Check(pDX, IDC_CHECK1, m_iso15693);
              DDX_Check(pDX, IDC_CHECK2, m_iso14443A);
              DDX_Check(pDX, IDC_CHECK3, m_iso14443B);
              DDX_Check(pDX, IDC_CHECK4, m_iso18000);
              DDX_Check(pDX, IDC_CHECK5, m_felica);
              //}}AFX_DATA_MAP
              }

              BEGIN_MESSAGE_MAP(CIso_benchDlg, CDialog)
              //{{AFX_MSG_MAP(CIso_benchDlg)
              ON_WM_TIMER()
              ON_BN_CLICKED(IDC_DETECT, OnDetect)
              //}}AFX_MSG_MAP
              END_MESSAGE_MAP()

              /////////////////////////////////////////////////////////////////////////////
              // CIso_benchDlg message handlers

              BOOL CIso_benchDlg::OnInitDialog()
              {
              CDialog::OnInitDialog();

              // Set the icon for this dialog.  The framework does this automatically
              //  when the application's main window is not a dialog
              SetIcon(m\_hIcon, TRUE);			// Set big icon
              
              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups