IPAddress.Broadcast IPAddress.Broadcast IPAddress.Broadcast IPAddress.Broadcast Field

定义

提供 IP 广播地址。Provides the IP broadcast address. 此字段为只读。This field is read-only.

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到控制台的地址。The following example prints the Broadcast address to the console.

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 'PrintBroadcastAddress

注解

Broadcast字段等效于 255.255.255.255 采用点分四组表示法。The Broadcast field is equivalent to 255.255.255.255 in dotted-quad notation.

适用于