IPAddressInformation IPAddressInformation IPAddressInformation IPAddressInformation Class

Definition

Stellt Informationen zur Adresse einer Netzwerkschnittstelle bereit.Provides information about a network interface address.

public ref class IPAddressInformation abstract
public abstract class IPAddressInformation
type IPAddressInformation = class
Public MustInherit Class IPAddressInformation
Vererbung
IPAddressInformationIPAddressInformationIPAddressInformationIPAddressInformation
Abgeleitet

Beispiele

Im folgenden Codebeispiel werden die Domain Name Service-(DNS-) Adressen für die Netzwerkschnittstellen auf dem lokalen Computer angezeigt.The following code example displays the Domain Name Service (DNS) addresses for the network interfaces on the local computer.

void DisplayDnsAddresses()
{
   array<NetworkInterface^>^adapters = NetworkInterface::GetAllNetworkInterfaces();
   System::Collections::IEnumerator^ myEnum11 = adapters->GetEnumerator();
   while ( myEnum11->MoveNext() )
   {
      NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum11->Current);
      IPInterfaceProperties ^ adapterProperties = adapter->GetIPProperties();
      IPAddressCollection ^ dnsServers = adapterProperties->DnsAddresses;
      if ( dnsServers->Count > 0 )
      {
         Console::WriteLine( adapter->Description );
         System::Collections::IEnumerator^ myEnum12 = dnsServers->GetEnumerator();
         while ( myEnum12->MoveNext() )
         {
            IPAddress ^ dns = safe_cast<IPAddress ^>(myEnum12->Current);
            Console::WriteLine( "  DNS Servers ............................. : {0}", 
               dns->ToString());
         }
      }
   }
}
public static void DisplayDnsAddresses()
{
    NetworkInterface[] adapters  = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in adapters)
    {

        IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
        IPAddressCollection dnsServers = adapterProperties.DnsAddresses;
        if (dnsServers.Count > 0)
        {
            Console.WriteLine(adapter.Description);
            foreach (IPAddress dns in dnsServers)
            {
                Console.WriteLine("  DNS Servers ............................. : {0}", 
                    dns.ToString());
            }
            Console.WriteLine();
        }
    }
}
Public Shared Sub DisplayDnsAddresses() 
    Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
    Dim adapter As NetworkInterface
    For Each adapter In  adapters
        
        Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties()
        Dim dnsServers As IPAddressCollection = adapterProperties.DnsAddresses
        If dnsServers.Count > 0 Then
            Console.WriteLine(adapter.Description)
            Dim dns As IPAddress
            For Each dns In  dnsServers
                Console.WriteLine("  DNS Servers ............................. : {0}",dns.ToString() )
            Next dns
        End If
    Next adapter

End Sub 'DisplayDnsAddresses

Hinweise

Sie erstellen keine Instanzen dieser Klasse. -Instanzen werden von Methoden in der IPInterfaceProperties -Klasse zurückgegeben.You do not create instances of this class; instances are returned by methods in the IPInterfaceProperties class.

Konstruktoren

IPAddressInformation() IPAddressInformation() IPAddressInformation() IPAddressInformation()

Initialisiert eine neue Instanz der IPAddressInformation-Klasse.Initializes a new instance of the IPAddressInformation class.

Eigenschaften

Address Address Address Address

Ruft die IP-Adresse (Internet Protocol) ab.Gets the Internet Protocol (IP) address.

IsDnsEligible IsDnsEligible IsDnsEligible IsDnsEligible

Ruft einen Boolean-Wert ab, der angibt, ob die IP (Internet Protocol)-Adresse in einer DNS (Domain Name System)-Serverdatenbank als gültig angezeigt werden kann.Gets a Boolean value that indicates whether the Internet Protocol (IP) address is valid to appear in a Domain Name System (DNS) server database.

IsTransient IsTransient IsTransient IsTransient

Ruft einen Boolean-Wert ab, der angibt, ob die IP-Adresse flüchtig ist (eine Clusteradresse).Gets a Boolean value that indicates whether the Internet Protocol (IP) address is transient (a cluster address).

Methoden

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Bestimmt, ob das angegebene Objekt mit dem aktuellen Objekt identisch ist.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Fungiert als Standardhashfunktion.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Ruft den Type der aktuellen Instanz ab.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Erstellt eine flache Kopie des aktuellen Object.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.Returns a string that represents the current object.

(Inherited from Object)

Gilt für: