Beispiel #1
0
        private static bool Ping(string address)
        {
            var       ping  = new System.Net.NetworkInformation.Ping();
            PingReply reply = null;

            try
            {
                reply = ping.Send(address);
            }
            catch (Exception e)
            {
                return(false);
            }

            if (reply != null)
            {
                return(reply.Status == IPStatus.Success);
            }

            return(false);
        }
Beispiel #2
0
        private static bool Ping(string address)
        {
            var ping = new System.Net.NetworkInformation.Ping();
            PingReply reply = null;
            try
            {
                reply = ping.Send(address);
            }
            catch (Exception e)
            {
                return false;
            }

            if (reply != null)
                return reply.Status == IPStatus.Success;

            return false;
        }