public static void Main(String[] args) { String portname = (args.Length != 0) ? args[0] : @"COM1"; PortSample inst = new PortSample(portname); inst.Start(); }