PingReply.Address PingReply.Address PingReply.Address PingReply.Address Property

Definition

Ruft die Adresse des Hosts ab, der die ICMP (Internet Control Message Protocol)-Echoantwort sendet.Gets the address of the host that sends the Internet Control Message Protocol (ICMP) echo reply.

public:
 property System::Net::IPAddress ^ Address { System::Net::IPAddress ^ get(); };
public System.Net.IPAddress Address { get; }
member this.Address : System.Net.IPAddress
Public ReadOnly Property Address As IPAddress

Eigenschaftswert

Eine IPAddress, die das Ziel für die ICMP-Echomeldung enthält.An IPAddress containing the destination for the ICMP echo message.

Beispiele

Im folgenden Codebeispiel sendet eine ICMP-Echoanfrage synchron und zeigt den Wert dieser Eigenschaft.The following code example sends an ICMP echo request synchronously and displays the value of this property.

void SimplePing()
{
   Ping ^ pingSender = gcnew Ping;
   PingReply ^ reply = pingSender->Send( "www.contoso.com" );
   if ( reply->Status == IPStatus::Success )
   {
      Console::WriteLine( "Address: {0}", reply->Address->ToString() );
      Console::WriteLine( "RoundTrip time: {0}", reply->RoundtripTime );
      Console::WriteLine( "Time to live: {0}", reply->Options->Ttl );
      Console::WriteLine( "Don't fragment: {0}", reply->Options->DontFragment );
      Console::WriteLine( "Buffer size: {0}", reply->Buffer->Length );
   }
   else
   {
      Console::WriteLine( reply->Status );
   }
}


public static void SimplePing ()
{
    Ping pingSender = new Ping ();
    PingReply reply = pingSender.Send ("www.contoso.com");

    if (reply.Status == IPStatus.Success)
    {
        Console.WriteLine ("Address: {0}", reply.Address.ToString ());
        Console.WriteLine ("RoundTrip time: {0}", reply.RoundtripTime);
        Console.WriteLine ("Time to live: {0}", reply.Options.Ttl);
        Console.WriteLine ("Don't fragment: {0}", reply.Options.DontFragment);
        Console.WriteLine ("Buffer size: {0}", reply.Buffer.Length);
    }
    else
    {
        Console.WriteLine (reply.Status);
    }
}

Hinweise

Die Address von zurückgegeben der Send Überladungen können von einem böswilligen Remotecomputer stammen.The Address returned by any of the Send overloads can originate from a malicious remote computer. Verbinden Sie nicht mit dem Remotecomputer an.Do not connect to the remote computer using this address. Verwenden Sie DNS, um die IP-Adresse des Computers zu bestimmen, zu dem Sie eine Verbindung herstellen möchten.Use DNS to determine the IP address of the machine to which you want to connect.

Gilt für: