static void Main(string[] args) { /* args = new string[4]; args[0] = "00:25:fc:00:02:bd"; args[1] = "1234"; args[2] = "fw"; args[3] = @"C:\users\engin\code\workspace-cpp\plc\app\plc.bin.enda"; * */ m_args = args; if (args.Length < 2) { Console.Error.WriteLine("Usage: plcctrl MAC|IP PASS ACTION PARAMS"); return; } IPEndPoint ip = null; if (args[0].Contains(":")) { Finder f = new Finder(); f.DeviceFound += new Finder.DeviceFoundHandler(f_DeviceFound); f.Scan(); m_wait.WaitOne(5000); } else { ip = new IPEndPoint(IPAddress.Parse(args[0]), 23); doit(ip, args); } }