Exemple #1
0
        public void SelectDevice()
        {
            List <string> availableReaders = this.ListReaders();

            this.RdrState         = new ACR122uCard.SCARD_READERSTATE();
            readername            = availableReaders[0].ToString();//selecting first device
            this.RdrState.RdrName = readername;
        }
Exemple #2
0
 public void SelectDevice()
 {
     //MessageBox.Show(this.ListReaders().Count.ToString());
     if (this.ListReaders().Count > 0)
     {
         List <string> availableReaders = this.ListReaders();
         this.RdrState         = new ACR122uCard.SCARD_READERSTATE();
         readername            = availableReaders[0].ToString();//selecting first device
         this.RdrState.RdrName = readername;
         if (retCode == 0)
         {
             //MessageBox.Show("Device successfully connected.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             //MessageBox.Show(ACR122uCard.GetScardErrMsg(retCode).ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         //MessageBox.Show(ACR122uCard.GetScardErrMsg(retCode).ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }