IPv4InterfaceProperties 클래스

정의

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

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

예제

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

public static void DisplayIPv4NetworkInterfaces()
{
    NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    Console.WriteLine("IPv4 interface information for {0}.{1}",
       properties.HostName, properties.DomainName);
    Console.WriteLine();

    foreach (NetworkInterface adapter in nics)
    {
        // Only display informatin for interfaces that support IPv4.
        if (!adapter.Supports(NetworkInterfaceComponent.IPv4))
        {
            continue;
        }
        Console.WriteLine(adapter.Description);
        // Underline the description.
        Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
        IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
        // Try to get the IPv4 interface properties.
        IPv4InterfaceProperties p = adapterProperties.GetIPv4Properties();

        // Display the IPv4 specific data.
        Console.WriteLine("  Index ............................. : {0}", p.Index);
        Console.WriteLine("  MTU ............................... : {0}", p.Mtu);
        Console.WriteLine("  APIPA active....................... : {0}",
            p.IsAutomaticPrivateAddressingActive);
        Console.WriteLine("  APIPA enabled...................... : {0}",
            p.IsAutomaticPrivateAddressingEnabled);
        Console.WriteLine("  Forwarding enabled................. : {0}",
            p.IsForwardingEnabled);
        Console.WriteLine("  Uses WINS ......................... : {0}",
            p.UsesWins);
        Console.WriteLine();
    }
}
Public Shared Sub DisplayIPv4NetworkInterfaces() 
    Dim nics As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Console.WriteLine("IPv4 interface information for {0}.{1}", properties.HostName, properties.DomainName)
    
    Dim adapter As NetworkInterface
    For Each adapter In  nics
        ' Only display informatin for interfaces that support IPv4.
        If adapter.Supports(NetworkInterfaceComponent.IPv4) = False Then
            GoTo ContinueForEach1
        End If
        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 IPv4 interface properties.
        Dim p As IPv4InterfaceProperties = adapterProperties.GetIPv4Properties()

        ' Display the IPv4 specific data.
        Console.WriteLine("  Index ............................. : {0}", p.Index)
        Console.WriteLine("  MTU ............................... : {0}", p.Mtu)
        Console.WriteLine("  APIPA active....................... : {0}", p.IsAutomaticPrivateAddressingActive)
        Console.WriteLine("  APIPA enabled...................... : {0}", p.IsAutomaticPrivateAddressingEnabled)
        Console.WriteLine("  Forwarding enabled................. : {0}", p.IsForwardingEnabled)
        Console.WriteLine("  Uses WINS ......................... : {0}", p.UsesWins)
    ContinueForEach1:
    Next adapter

End Sub

설명

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

IPV6 속성은 다음을 참조하세요 GetIPv6Properties.

생성자

Name Description
IPv4InterfaceProperties()

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

속성

Name Description
Index

IPv4(인터넷 프로토콜 버전 4) 주소와 연결된 네트워크 인터페이스의 인덱스입니다.

IsAutomaticPrivateAddressingActive

이 인터페이스에 Boolean APIPA(자동 개인 IP 주소 지정) 주소가 있는지 여부를 나타내는 값을 가져옵니다.

IsAutomaticPrivateAddressingEnabled

Boolean 이 인터페이스에 APIPA(자동 개인 IP 주소 지정)가 사용하도록 설정되어 있는지 여부를 나타내는 값을 가져옵니다.

IsDhcpEnabled

Boolean 인터페이스가 DHCP(동적 호스트 구성 프로토콜) 서버를 사용하여 IP 주소를 가져오도록 구성되었는지 여부를 나타내는 값을 가져옵니다.

IsForwardingEnabled

이 인터페이스가 패킷을 Boolean 전달(경로)할 수 있는지 여부를 나타내는 값을 가져옵니다.

Mtu

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

UsesWins

인터페이스가 WINDOWS WINS(Internet Name Service)를 사용하는지 여부를 나타내는 Boolean 값을 가져옵니다.

메서드

Name Description
Equals(Object)

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

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

기본 해시 함수로 사용됩니다.

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상