IPAddress.None 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供一个 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 来指示不应使用网络接口。
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。