Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="readerName"></param>
        /// <returns></returns>
        protected string ReadCardUid(string readerName)
        {
            string uid = "";

            NFCReader reader = new NFCReader();

            reader.Connect(readerName);
            uid = BitConverter.ToString(reader.GetUID()).Replace("-", string.Empty);
            reader.Disconnect();

            return(uid);
        }
Пример #2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Reading NFC Readers");
            var nfc = new NFCReader();

            try
            {
                nfc.Connect();
            }
            catch (Exception e)
            {
                Console.WriteLine("failed to connect");
                Console.WriteLine(e);
            }
            var readers = nfc.GetReadersList();

            Console.WriteLine("Found " + readers.Count);
            foreach (var reader in readers)
            {
                Console.WriteLine(reader);
            }

            Console.ReadLine();
        }