Example #1
0
        /// <summary>
        /// Verifica si hay una tarjeta presente en el lector.
        /// </summary>
        /// <returns>True si hay una tarjeta presente, False en caso contrario</returns>
        public bool CheckIfCardIsPresent()
        {
            bool b = false;

            int cardstate = scardr.GetReaderState(_strReaderName);

            if (cardstate == SCardRoutines.CARD_PRESENT)
            {
                b = true;
            }
            if (cardstate == SCardRoutines.CARD_NOT_PRESENT)
            {
                b = false;
            }

            return(b);
        }