static void Main() { TechnotrendReceiver c; try { c = new TechnotrendReceiver(); c.RemoteCallback += new RemoteHandler(Remote); c.Start(); System.Windows.Forms.Application.Run(); c.Stop(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } finally { c = null; } Console.ReadKey(); }