static void Main(string[] args) { foreach (string arg in args) { // enter debug mode if (arg.StartsWith("d")) { RunDebugMode(arg); return; } } Detection d = new Detection(); d.Run(); Camera c = new Camera(); c.Run(); Console.ReadKey(); }