Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            if (!Parse(args))
            {
                ExitUsage();
            }

            Console.Write("Ping " + IP.ToString() + " ");
            PingReply reply = Ping(IP, Timeout, MaxTtl);

            Console.WriteLine(reply.Status.ToString() + ". ");
            if (reply.Status != IPStatus.Success)
            {
                Exit();
            }

            Console.WriteLine();
            Console.WriteLine("Tracert: ");
            for (int ttl = 1; ttl <= MaxTtl; ttl++)
            {
                reply = Ping(IP, Timeout, ttl);
                if (reply.Address != null)
                {
                    Console.Write(ttl + "\t" + reply.Address.ToString() + "\t");
                    Console.WriteLine(Searcher.Search(reply.Address));
                }

                if (reply.Status == IPStatus.Success)
                {
                    break;
                }
            }
        }