Example #1
0
 /// <summary>
 /// Terminates a connection previously opened between the calling application and a smart card in the target reader.
 /// </summary>
 /// <param name="disposition">Action to take on the card in the connected reader on close.</param>
 public void Disconnect(DispositionOptions disposition)
 {
     if (_hCard != IntPtr.Zero)
     {
         int rtn = SCardDll.SCardDisconnect(_hCard, (UInt32)disposition);
         EvalReturnCode(rtn);
         _hCard = IntPtr.Zero;
     }
 }
Example #2
0
        /// <summary>
        /// Completes a previously declared transaction, allowing other applications to resume interactions with the card.
        /// </summary>
        /// <param name="disposition">Action to take on the card in the connected reader on close.</param>
        public void EndTransaction(DispositionOptions disposition)
        {
            if (_hContext == IntPtr.Zero)
            {
                throw new SCardException("No card reader context established.  Must call SCard.EstablishContext() first.");
            }
            if (_hCard == IntPtr.Zero)
            {
                throw new SCardException("Not connected to card. Must call SCard.Connect() method first.");
            }
            int rtn = SCardDll.SCardEndTransaction(_hCard, (UInt32)disposition);

            EvalReturnCode(rtn);
        }
Example #3
0
 /// <summary>
 /// Completes a previously declared transaction, allowing other applications to resume interactions with the card.
 /// </summary>
 /// <param name="disposition">Action to take on the card in the connected reader on close.</param>
 public void EndTransaction(DispositionOptions disposition)
 {
     if (_hContext == IntPtr.Zero)
         throw new SCardException("No card reader context established.  Must call SCard.EstablishContext() first.");
     if (_hCard == IntPtr.Zero)
         throw new SCardException("Not connected to card. Must call SCard.Connect() method first.");
     int rtn = SCardDll.SCardEndTransaction(_hCard, (UInt32)disposition);
     EvalReturnCode(rtn);
 }
Example #4
0
 /// <summary>
 /// Terminates a connection previously opened between the calling application and a smart card in the target reader.
 /// </summary>
 /// <param name="disposition">Action to take on the card in the connected reader on close.</param>
 public void Disconnect(DispositionOptions disposition)
 {
     if (_hCard != IntPtr.Zero)
     {
         int rtn = SCardDll.SCardDisconnect(_hCard, (UInt32)disposition);
         EvalReturnCode(rtn);
         _hCard = IntPtr.Zero;
     }
 }