IPv6InterfaceProperties IPv6InterfaceProperties IPv6InterfaceProperties IPv6InterfaceProperties Class

Definition

Stellt Informationen über Netzwerkschnittstellen bereit, die Internetprotokoll, Version 6 (IPv6), unterstützen.Provides information about network interfaces that support Internet Protocol version 6 (IPv6).

public ref class IPv6InterfaceProperties abstract
public abstract class IPv6InterfaceProperties
type IPv6InterfaceProperties = class
Public MustInherit Class IPv6InterfaceProperties
Vererbung
IPv6InterfacePropertiesIPv6InterfacePropertiesIPv6InterfacePropertiesIPv6InterfaceProperties

Beispiele

Im folgenden Codebeispiel wird ein IPInterfaceProperties -Objekts und zeigt die Daten.The following code example gets an IPInterfaceProperties object and displays its data.

void DisplayIPv6NetworkInterfaces()
{
   array<NetworkInterface^>^nics = NetworkInterface::GetAllNetworkInterfaces();
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   Console::WriteLine( "IPv6 interface information for {0}.{1}", 
       properties->HostName, properties->DomainName );

   int count = 0;

   System::Collections::IEnumerator^ myEnum24 = nics->GetEnumerator();
   while ( myEnum24->MoveNext() )
   {
      NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum24->Current);

      // Only display informatin for interfaces that support IPv6.
      if ( adapter->Supports( NetworkInterfaceComponent::IPv6 ) == false )
      {
         continue;
      }
      
      count++;
      
      Console::WriteLine();
      Console::WriteLine( adapter->Description );

      // Underline the description.
      Console::WriteLine( String::Empty->PadLeft( adapter->Description->Length, '=' ) );
      IPInterfaceProperties ^ adapterProperties = adapter->GetIPProperties();

      // Try to get the IPv6 interface properties.
      IPv6InterfaceProperties ^ p = adapterProperties->GetIPv6Properties();
      if ( !p )
      {
         Console::WriteLine( "No IPv6 information is available for this interface." );
         continue;
      }

      // Display the IPv6 specific data.
      Console::WriteLine( "  Index ............................. : {0}", 
         p->Index );
      Console::WriteLine( "  MTU ............................... : {0}", 
         p->Mtu );
   }
   if (count == 0)
   {
       Console::WriteLine("  No IPv6 interfaces were found.");
       Console::WriteLine();
   }
}
public static void DisplayIPv6NetworkInterfaces()
{
    NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    Console.WriteLine("IPv6 interface information for {0}.{1}",
       properties.HostName, properties.DomainName);

    int count = 0;
    
    foreach (NetworkInterface adapter in nics)
    {
        // Only display informatin for interfaces that support IPv6.
        if (adapter.Supports(NetworkInterfaceComponent.IPv6) == false)
        {
            continue;
        }

        count++;

        Console.WriteLine();
        Console.WriteLine(adapter.Description);
        // Underline the description.
        Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
        
        IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
        // Try to get the IPv6 interface properties.
        IPv6InterfaceProperties p = adapterProperties.GetIPv6Properties();

   
        if (p == null)
        {
            Console.WriteLine("No IPv6 information is available for this interface.");
            Console.WriteLine();
            continue;
        }
        // Display the IPv6 specific data.
        Console.WriteLine("  Index ............................. : {0}", p.Index);
        Console.WriteLine("  MTU ............................... : {0}", p.Mtu);
    }

    if (count == 0)
    {
        Console.WriteLine("  No IPv6 interfaces were found.");
        Console.WriteLine();
    }
    
}
Public Shared Sub DisplayIPv6NetworkInterfaces() 
    Dim nics As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Console.WriteLine("IPv6 interface information for {0}.{1}", properties.HostName, properties.DomainName)
    
    Dim count as Integer = 0
    
    Dim adapter As NetworkInterface
    For Each adapter In  nics
        ' Only display informatin for interfaces that support IPv6.
        If adapter.Supports(NetworkInterfaceComponent.IPv6) = False Then
            GoTo ContinueForEach1
        End If
        count += 1
        
        Console.WriteLine()
        Console.WriteLine(adapter.Description)
        ' Underline the description.
        Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length, "="c))
        
        Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties()
        ' Try to get the IPv6 interface properties.
        Dim p As IPv6InterfaceProperties = adapterProperties.GetIPv6Properties()
        
        
        If p Is Nothing Then
            Console.WriteLine("No IPv6 information is available for this interface.")
            GoTo ContinueForEach1
        End If
        ' Display the IPv6 specific data.
        Console.WriteLine("  Index ............................. : {0}", p.Index)
        Console.WriteLine("  MTU ............................... : {0}", p.Mtu)
    ContinueForEach1:
    Next adapter

    if count = 0 then
        Console.WriteLine("  No IPv6 interfaces were found.")
        Console.WriteLine()
    End if

End Sub 'DisplayIPv6NetworkInterfaces

Hinweise

Diese Klasse stellt den Zugriff auf Konfigurations- und Adressinformationen für Netzwerkschnittstellen, die Unterstützung von IPv6.This class provides access to configuration and address information for network interfaces that support IPv6. Erstellen Sie Instanzen dieser Klasse nicht. Diese zurückgegeben werden, indem die GetIPv6Properties Methode.You do not create instances of this class; they are returned by the GetIPv6Properties method.

IPv4-Eigenschaften finden Sie unter GetIPv4Properties.For IPV4 properties, see GetIPv4Properties.

Konstruktoren

IPv6InterfaceProperties() IPv6InterfaceProperties() IPv6InterfaceProperties() IPv6InterfaceProperties()

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

Eigenschaften

Index Index Index Index

Ruft den Index der einer IPv6 (Internet Protocol, Version 6)-Adresse zugeordneten Netzwerkschnittstelle ab.Gets the index of the network interface associated with an Internet Protocol version 6 (IPv6) address.

Mtu Mtu Mtu Mtu

Ruft die maximale Übertragungseinheit für diese Netzwerkschnittstelle ab.Gets the maximum transmission unit (MTU) for this network interface.

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)
GetScopeId(ScopeLevel) GetScopeId(ScopeLevel) GetScopeId(ScopeLevel) GetScopeId(ScopeLevel)

Ruft die Bereichs-ID einer IPv6 (Internet Protocol, Version 6)-Adresse zugeordneten Netzwerkschnittstelle ab.Gets the scope ID of the network interface associated with an Internet Protocol version 6 (IPv6) address.

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: