Beispiel #1
0
        public void Run(string readerName)
        {
            var reader = new SmartCardReader(readerName);

            try
            {
                ConsoleWriter.Instance.PrintSplitter();
                ConsoleWriter.Instance.PrintTask($"Connecting to {reader.PcscReaderName}");

                ReaderHelper.ConnectToReaderWithCard(reader);

                ConsoleWriter.Instance.PrintMessage($"Connected\nConnection Mode: {reader.ConnectionMode}");

                ReaderHelper.GetDataCommand(reader, "Get Historical Bytes", GetDataCommand.Type.Specific);

                ConsoleWriter.Instance.PrintSplitter();
            }
            catch (Exception e)
            {
                ConsoleWriter.Instance.PrintError(e.Message);
            }
            finally
            {
                if (reader.IsConnected)
                {
                    reader.Disconnect(CardDisposition.Unpower);
                    ConsoleWriter.Instance.PrintMessage("Reader connection closed");
                }
                ConsoleWriter.Instance.PrintSplitter();
            }
        }