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 属性来指示不应使用网络接口。
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。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈