Exemple #1
0
        private void InitCardReader()
        {
            iCard = new CardNative();

            string[] readers = new string[0];
            try
            {
                readers = iCard.ListReaders();
            }
            catch (Exception)
            {
                if (iCard.LastError == 0x8010001D)
                {
                    Status = "Smart card service not running.";
                    return;
                }
            }
            if (readers.Length == 0)
            {
                Status = "No card readers found.";
                return;
            }
            reader = readers[0];
            Status = reader;

            iCard.OnCardInserted += new CardInsertedEventHandler(iCard_OnCardInserted);
            iCard.OnCardRemoved  += new CardRemovedEventHandler(iCard_OnCardRemoved);
            iCard.StartCardEvents(readers[0]);

            try
            {
                StartReadCard();
            }
            catch (Exception e)
            {
                //System.Diagnostics.Debug.Assert(false, e.Message + " " + e.StackTrace);
                if (iCard.LastError == 0x80100069)
                {
                    Status = "No card inserted.";
                }
                else
                {
                    Status = e.Message;
                    System.Diagnostics.Debug.Assert(false, e.Message + " " + iCard.LastError + " " + e.StackTrace);
                }
                //no card present, do nothing
            }
        }
Exemple #2
0
 public EMVCard(CardNative cardUpdater)
 {
     this.cardUpdater = cardUpdater;
     this.Properties = new List<object>();
 }
 public NETSCashCard(CardNative reader)
 {
     this.iCard = reader;
     this.TransactionLog = new List<NETSTransaction>();
 }
Exemple #4
0
 public NETSCashCard(CardNative reader)
 {
     this.iCard          = reader;
     this.TransactionLog = new List <NETSTransaction>();
 }
Exemple #5
0
 public MyKad(CardNative reader)
 {
     this.cardUpdater = reader;
 }
 /*public TouchNGoCard(byte[] paramArrayOfByte)
 {
   this.m_proxyAppletAID = paramArrayOfByte;
 }*/
 public TouchNGoCard(CardNative reader)
 {
     this.cardUpdater = reader;
 }
 public void setCardUpdater(CardNative paramCardUpdater)
 {
     this.cardUpdater = paramCardUpdater;
 }
Exemple #8
0
 public MyKad(CardNative reader)
 {
     this.cardUpdater = reader;
 }
        private void InitCardReader()
        {
            iCard = new CardNative();

            string[] readers = new string[0];
            try
            {
                readers = iCard.ListReaders();
            }
            catch (Exception)
            {
                if (iCard.LastError == 0x8010001D)
                {
                    Status = "Smart card service not running.";
                    return;
                }
            }
            if (readers.Length == 0)
            {
                Status = "No card readers found.";
                return;
            }
            reader = readers[0];
            Status = reader;

            iCard.OnCardInserted += new CardInsertedEventHandler(iCard_OnCardInserted);
            iCard.OnCardRemoved += new CardRemovedEventHandler(iCard_OnCardRemoved);
            iCard.StartCardEvents(readers[0]);

            try
            {
                StartReadCard();
            }
            catch (Exception e)
            {
                //System.Diagnostics.Debug.Assert(false, e.Message + " " + e.StackTrace);
                if (iCard.LastError == 0x80100069)
                    Status = "No card inserted.";
                else
                {
                    Status = e.Message;
                    System.Diagnostics.Debug.Assert(false, e.Message + " "+ iCard.LastError+ " "+ e.StackTrace );
                }
                //no card present, do nothing
            }
        }
Exemple #10
0
 public EMVCard(CardNative cardUpdater)
 {
     this.cardUpdater = cardUpdater;
     this.Properties  = new List <object>();
 }
Exemple #11
0
        /*public TouchNGoCard(byte[] paramArrayOfByte)
         * {
         * this.m_proxyAppletAID = paramArrayOfByte;
         * }*/

        public TouchNGoCard(CardNative reader)
        {
            this.cardUpdater = reader;
        }
Exemple #12
0
 public void setCardUpdater(CardNative paramCardUpdater)
 {
     this.cardUpdater = paramCardUpdater;
 }