IPAddress.None 字段

定义

提供指示不应使用任何网络接口的 IP 地址。 此字段为只读。

public: static initonly System::Net::IPAddress ^ None;
public static readonly System.Net.IPAddress None;
 staticval mutable None : System.Net.IPAddress
Public Shared ReadOnly None As IPAddress 

字段值

示例

以下示例使用 None 属性来指示不应使用任何网络接口。

int main()
{
   
   // Gets the IP address indicating that no network interface should be used
   // and converts it to a String*.
   String^ address = IPAddress::None->ToString();
   Console::WriteLine( "IP address : {0}", address );
}
public static void Main()
{
   // Gets the IP address indicating that no network interface should be used
   // and converts it to a string.
   string address = IPAddress.None.ToString();
   Console.WriteLine("IP address : " + address);
}
Public Shared Sub Main()

    ' Gets the IP address indicating that no network interface should be used
    ' and converts it to a string. 
    Dim address As String = IPAddress.None.ToString()
    Console.WriteLine(("IP address : " + address))
End Sub

注解

Socket.Bind方法使用 None 字段来指示 Socket 不得侦听客户端活动。 字段 None 等效于虚四表示法中的 255.255.255.255。

适用于