Пример #1
0
        static void Main(string[] args)
        {
            using (var ctx = new FreeFareContext())
            {
                string codeBase = Assembly.GetExecutingAssembly().CodeBase;
                string name     = Path.GetFileNameWithoutExtension(codeBase);
                Console.WriteLine($"{name} uses libnfc {ctx.Version()}");


                var lst = ctx.ListDeviceNames();
                Console.WriteLine($"{lst.Count} NFC device(s) found:");
                foreach (var d in lst)
                {
                    Console.WriteLine(d);
                }
                Console.ReadKey();
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            using (var ctx = new FreeFareContext())
            {
                string codeBase = Assembly.GetExecutingAssembly().CodeBase;
                string name     = Path.GetFileNameWithoutExtension(codeBase);
                Console.WriteLine($"{name} uses libnfc {ctx.Version()}");

                var lst    = ctx.ListDeviceNames();
                var device = ctx.OpenDevice(lst.First());
                var ffd    = ctx.ConvertToFreeFareDevice(device);
                var tags   = ffd.GetTags();
                foreach (var t in tags)
                {
                    Console.WriteLine(t.GetStructure().tag_info);
                }
                Console.ReadKey();
            }
        }