MulticastOption.LocalAddress 属性

定义

获取或设置与多路广播组关联的本地地址。

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

属性值

与多播组关联的本地地址。

示例

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

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

注解

属性 LocalAddress 包含与多播组成员身份关联的接口的 IP 地址。 如果 LocalAddress 设置为 Any,则使用默认接口。

适用于