Example #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
            }
        }
Example #2
0
 public EMVCard(CardNative cardUpdater)
 {
     this.cardUpdater = cardUpdater;
     this.Properties = new List<object>();
 }
Example #3
0
 public NETSCashCard(CardNative reader)
 {
     this.iCard = reader;
     this.TransactionLog = new List<NETSTransaction>();
 }
Example #4
0
 public NETSCashCard(CardNative reader)
 {
     this.iCard          = reader;
     this.TransactionLog = new List <NETSTransaction>();
 }
Example #5
0
 public MyKad(CardNative reader)
 {
     this.cardUpdater = reader;
 }
Example #6
0
 /*public TouchNGoCard(byte[] paramArrayOfByte)
 {
   this.m_proxyAppletAID = paramArrayOfByte;
 }*/
 public TouchNGoCard(CardNative reader)
 {
     this.cardUpdater = reader;
 }
Example #7
0
 public void setCardUpdater(CardNative paramCardUpdater)
 {
     this.cardUpdater = paramCardUpdater;
 }
Example #8
0
 public MyKad(CardNative reader)
 {
     this.cardUpdater = reader;
 }
Example #9
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
            }
        }
Example #10
0
 public EMVCard(CardNative cardUpdater)
 {
     this.cardUpdater = cardUpdater;
     this.Properties  = new List <object>();
 }
Example #11
0
        /*public TouchNGoCard(byte[] paramArrayOfByte)
         * {
         * this.m_proxyAppletAID = paramArrayOfByte;
         * }*/

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