示例#1
0
        public void TestCardReader()
        {
            var reader = new CardReader();

            reader.OpenDevice();
            var count     = 10;
            var sleepTime = 1000;

            while (count > 0)
            {
                var uid = reader.ReadUid();
                if (uid != "")
                {
                    Console.WriteLine(uid);
                    reader.Beep(100);
                    count--;
                    sleepTime = 3000;
                }
                else
                {
                    sleepTime = 1000;
                }
                Thread.Sleep(sleepTime);
            }
            reader.CloseDevice();
        }
 public void Beep(int duration)
 {
     if (reader.Connect())
     {
         reader.Beep(Convert.ToByte(duration));
         reader.Disconnect();
     }
 }