Exemplo n.º 1
0
        public int Run(string[] args)
        {
            try
            {
                if (!(args.Length > 1))
                {
                    if (Int32.TryParse(args[0], out var tmp))
                    {
                        _processor.Ping(tmp);
                    }
                    else
                    {
                        _processor.Ping();
                    }
                }
                else
                {
                    throw new ArgumentNullException(nameof(args));
                }

                return(1);
            }
            catch (Exception e)
            {
                Console.WriteLine("Неудачная попытка старта пинга");
                return(0);
            }
        }