Aracılığıyla paylaş


IPv6InterfaceProperties Sınıf

Tanım

İnternet Protokolü sürüm 6(IPv6) destekleyen ağ arabirimleri hakkında bilgi sağlar.

public ref class IPv6InterfaceProperties abstract
public abstract class IPv6InterfaceProperties
type IPv6InterfaceProperties = class
Public MustInherit Class IPv6InterfaceProperties
Devralma
IPv6InterfaceProperties

Örnekler

Aşağıdaki kod örneği bir IPInterfaceProperties nesneyi alır ve verilerini görüntüler.

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))
        {
            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

Açıklamalar

Bu sınıf, IPv6'yi destekleyen ağ arabirimleri için yapılandırma ve adres bilgilerine erişim sağlar. Bu sınıfın örneklerini oluşturmazsınız; yöntemi tarafından GetIPv6Properties döndürülür.

IPV4 özellikleri için bkz GetIPv4Properties. .

Oluşturucular

Name Description
IPv6InterfaceProperties()

IPv6InterfaceProperties sınıfının yeni bir örneğini başlatır.

Özellikler

Name Description
Index

İnternet Protokolü sürüm 6 (IPv6) adresiyle ilişkili ağ arabiriminin dizinini alır.

Mtu

Bu ağ arabirimi için maksimum iletim birimini (MTU) alır.

Yöntemler

Name Description
Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetScopeId(ScopeLevel)

İnternet Protokolü sürüm 6 (IPv6) adresiyle ilişkili ağ arabiriminin kapsam kimliğini alır.

GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır