private void Form1_Disposed(object sender, EventArgs e) { timer1.Stop(); if (_API != null && _API.IsConnected) { _API.Close(); } }
static void Main(string[] args) { var api = new CF_RL129_API.API("COM2"); api.Connect(); var running = true; while (running) { var cmd = Console.ReadLine(); switch (cmd) { case "b": api.Beep(); break; case "r": api.ReadTag(); break; case "i": api.GetId(); break; case "copy": { Console.WriteLine("Please insert source TAG and press Enter"); Console.ReadLine(); var tag = api.ReadTag(); Console.WriteLine("Please insert target TAG and press Enter"); Console.ReadLine(); api.WriteTag(tag); } break; case "exit": running = false; break; } } api.Close(); }