System.Net.NetworkInformation.Ping.Send C# (CSharp) Method

Send() public method

public Send ( System address ) : PingReply
address System
return PingReply
        public PingReply Send(System.Net.IPAddress address) { throw null; }
        public PingReply Send(System.Net.IPAddress address, int timeout) { throw null; }

Same methods

Ping::Send ( System address, int timeout ) : PingReply
Ping::Send ( System address, int timeout, byte buffer ) : PingReply
Ping::Send ( System address, int timeout, byte buffer, System options ) : PingReply
Ping::Send ( string hostNameOrAddress ) : PingReply
Ping::Send ( string hostNameOrAddress, int timeout ) : PingReply
Ping::Send ( string hostNameOrAddress, int timeout, byte buffer ) : PingReply
Ping::Send ( string hostNameOrAddress, int timeout, byte buffer, System options ) : PingReply

Usage Example

Beispiel #1
0
        public Ping(string[] Args, Connections Conn)
        {
            Interface.Message.Send("^6» ^7Medindo sua taxa de latência, e a taxa de latência do servidor. Aguarde...", Conn.UCID);

            System.Net.NetworkInformation.Ping _Ping = new System.Net.NetworkInformation.Ping();
            PingReply Reply   = _Ping.Send((new WebClient().DownloadString(new Uri("https://api.ipify.org/"))));
            PingReply ReplyMe = null;

            if (!string.IsNullOrWhiteSpace(Conn.IP))
            {
                ReplyMe = _Ping.Send(Conn.IP);
            }
            else
            {
                ReplyMe = _Ping.Send("127.0.0.1");
            }

            if (Reply.Status == IPStatus.Success && ReplyMe.Status == IPStatus.Success)
            {
                Interface.Message.Send($"^6» ^7O ping atual desse servidor é ^6{Reply.RoundtripTime.ToString()}ms", Conn.UCID);
                Interface.Message.Send($"^6» ^7O seu ping atual nesse servidor é ^6{ReplyMe.RoundtripTime.ToString()}ms", Conn.UCID);
            }
            else
            {
                Interface.Message.Send($"^1» ^7O seu ping ou o ping do servidor está muito alto, então não foi possível identificar.", Conn.UCID);
            }
        }
All Usage Examples Of System.Net.NetworkInformation.Ping::Send