IPv6InterfaceProperties 클래스

정의

IPv6(인터넷 프로토콜 버전 6)을 지원하는 네트워크 인터페이스에 대한 정보를 제공합니다.

public ref class IPv6InterfaceProperties abstract
public abstract class IPv6InterfaceProperties
type IPv6InterfaceProperties = class
Public MustInherit Class IPv6InterfaceProperties
상속
IPv6InterfaceProperties

예제

다음 코드 예제에서는 개체를 IPInterfaceProperties 가져오고 해당 데이터를 표시합니다.

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

설명

이 클래스는 IPv6을 지원하는 네트워크 인터페이스에 대한 구성 및 주소 정보에 대한 액세스를 제공합니다. 이 클래스의 인스턴스는 만들지 않습니다. 메서드에서 GetIPv6Properties 반환됩니다.

IPV4 속성은 을 참조하세요 GetIPv4Properties.

생성자

IPv6InterfaceProperties()

IPv6InterfaceProperties 클래스의 새 인스턴스를 초기화합니다.

속성

Index

인터넷 프로토콜 버전 6(IPv6) 주소와 연결된 네트워크 인터페이스의 인덱스를 가져옵니다.

Mtu

이 네트워크 인터페이스의 MTU(최대 전송 단위)를 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetScopeId(ScopeLevel)

인터넷 프로토콜 버전 6(IPv6) 주소와 연결된 네트워크 인터페이스의 범위 ID를 가져옵니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상