MulticastOption.Group 属性

定义

获取或设置多路广播组的 IP 地址。

public:
 property System::Net::IPAddress ^ Group { System::Net::IPAddress ^ get(); void set(System::Net::IPAddress ^ value); };
public System.Net.IPAddress Group { get; set; }
member this.Group : System.Net.IPAddress with get, set
Public Property Group As IPAddress

属性值

多播组的 IP 地址。

例外

.NET 5 及更高版本: groupnull

示例

以下示例显示此属性的值。

static void MulticastOptionProperties()
{
   Console::WriteLine( "Current multicast group is: {0}", mcastOption->Group );
   Console::WriteLine( "Current multicast local address is: {0}", mcastOption->LocalAddress );
}
private static void MulticastOptionProperties()
{
    Console.WriteLine("Current multicast group is: " + s_mcastOption.Group);
    Console.WriteLine("Current multicast local address is: " + s_mcastOption.LocalAddress);
}
Private Shared Sub MulticastOptionProperties()
  Console.WriteLine(("Current multicast group is: " + mcastOption.Group.ToString()))
  Console.WriteLine(("Current multicast local address is: " + mcastOption.LocalAddress.ToString()))
End Sub

注解

多播数据包的有效 IP 地址范围为 224.0.0.0 到 239.255.255.255。

适用于