IPAddress.Broadcast 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供 IP 广播地址。 此字段为只读。
public: static initonly System::Net::IPAddress ^ Broadcast;
public static readonly System.Net.IPAddress Broadcast;
staticval mutable Broadcast : System.Net.IPAddress
Public Shared ReadOnly Broadcast As IPAddress
字段值
示例
以下示例将 Broadcast 地址输出到控制台。
void PrintBroadcastAddress()
{
// Get the IP Broadcast address and convert it to string.
String^ IpAddressString = IPAddress::Broadcast->ToString();
Console::WriteLine( "\nBroadcast IP address : {0}", IpAddressString );
}
public void PrintBroadcastAddress()
{
// Get the IP Broadcast address and convert it to string.
string ipAddressString = IPAddress.Broadcast.ToString();
Console.WriteLine("Broadcast IP address: {0}", ipAddressString);
}
Public Sub PrintBroadcastAddress()
' gets the IP Broadcast address and convert it to string.
Dim IpAddressString As [String] = IPAddress.Broadcast.ToString()
Console.WriteLine((ControlChars.Cr + "Broadcast IP address : " + IpAddressString))
End Sub
注解
字段 Broadcast 等效于虚四表示法中的 255.255.255.255。