IPAddress.IPv6None 필드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
네트워크 인터페이스를 사용하지 않아야 함을 나타내는 IP 주소를 제공합니다. 이 속성은 읽기 전용입니다.
public: static initonly System::Net::IPAddress ^ IPv6None;
public static readonly System.Net.IPAddress IPv6None;
staticval mutable IPv6None : System.Net.IPAddress
Public Shared ReadOnly IPv6None As IPAddress
필드 값
예제
다음 코드 예제에서는 현재 호스트의 None 주소 값을 표준 압축 형식으로 표시합니다.
// This method displays the value of the current host's None address in
// standard compressed format. The None address is used by the host to disable
// listening to client activities on all the interfaces.
private static void displayIPv6NoneAddress()
{
try
{
// Get the None address.
IPAddress none = IPAddress.IPv6None;
// Transform the None address to a string using the overloaded
// ToString() method. Note that the resulting string is in the compact
// form: "::".
string ipv6None = none.ToString();
Console.WriteLine("The IPv6 None address is: " + ipv6None);
}
catch (Exception e)
{
Console.WriteLine("[displayIPv6NoneAddress] Exception: " + e.ToString());
}
}
' This function prints the value of the current host's None address in
' standard compressed format. The None address is used by the host to disable
' listening to client activities on all the interfaces.
Private Shared Sub printIPv6NoneAddress()
Try
' Get the None address.
Dim none As IPAddress = IPAddress.IPv6None
' Transform the None address to a string using the overloaded
' ToString() method. Note that the resulting string is in the compact
' form: "::".
Dim ipv6None As String = none.ToString()
Console.WriteLine(("The IPv6 None address is: " + ipv6None))
Catch e As Exception
Console.WriteLine(("[printIPv6NoneAddress] Exception: " + e.ToString()))
End Try
End Sub
설명
메서드는 Socket.BindIPv6None 필드를 사용하여 가 Socket 클라이언트 작업을 수신 대기하지 않아야 함을 나타냅니다. IPv6None 필드는 콜론-16진수 표기법에서 0:0:0:0:0:0:0 또는 압축 표기법의 ::0과 같습니다.