IPv6MulticastOption 类

定义

包含用于加入 IPv6 多路广播组的选项值。Contains option values for joining an IPv6 multicast group.

public ref class IPv6MulticastOption
public class IPv6MulticastOption
type IPv6MulticastOption = class
Public Class IPv6MulticastOption
继承
IPv6MulticastOption

示例

下面的示例创建一个 IPv6MulticastOption 对象。The following example creates an IPv6MulticastOption object.

// Exercise the use of the IPv6MulticastOption.
Console::WriteLine( "Instantiate IPv6MulticastOption(IPAddress)" );

// Instantiate IPv6MulticastOption using one of the
// overloaded constructors.
IPv6MulticastOption^ ipv6MulticastOption = gcnew IPv6MulticastOption( m_GrpAddr );

// Store the IPAdress multicast options.
IPAddress^ group = ipv6MulticastOption->Group;
__int64 interfaceIndex = ipv6MulticastOption->InterfaceIndex;

// Display IPv6MulticastOption properties.
Console::WriteLine( "IPv6MulticastOption::Group: [ {0}]", group );
Console::WriteLine( "IPv6MulticastOption::InterfaceIndex: [ {0}]", interfaceIndex );

    // Exercise the use of the IPv6MulticastOption.
    Console.WriteLine("Instantiate IPv6MulticastOption(IPAddress)");

    // Instantiate IPv6MulticastOption using one of the 
    // overloaded constructors.
    IPv6MulticastOption ipv6MulticastOption = new IPv6MulticastOption(m_GrpAddr);

    // Store the IPAdress multicast options.
    IPAddress group =  ipv6MulticastOption.Group;
    long interfaceIndex = ipv6MulticastOption.InterfaceIndex;

    // Display IPv6MulticastOption properties.
    Console.WriteLine("IPv6MulticastOption.Group: [" + group  + "]");
    Console.WriteLine("IPv6MulticastOption.InterfaceIndex: [" + interfaceIndex + "]");

' Exercise the use of the IPv6MulticastOption.
Console.WriteLine("Instantiate IPv6MulticastOption(IPAddress)")

' Instantiate IPv6MulticastOption using one of the 
' overloaded constructors.
Dim ipv6MulticastOption As New IPv6MulticastOption(m_GrpAddr)

' Store the IPAdress multicast options.
Dim group As IPAddress = ipv6MulticastOption.Group
Dim interfaceIndex As Long = ipv6MulticastOption.InterfaceIndex

' Display IPv6MulticastOption properties.
Console.WriteLine(("IPv6MulticastOption.Group: [" + group.ToString() + "]"))
Console.WriteLine(("IPv6MulticastOption.InterfaceIndex: [" + interfaceIndex.ToString() + "]"))

构造函数

IPv6MulticastOption(IPAddress)

为指定的 IP 多路广播组初始化 IPv6MulticastOption 类的新版本。Initializes a new version of the IPv6MulticastOption class for the specified IP multicast group.

IPv6MulticastOption(IPAddress, Int64)

使用指定的 IP 多路广播组和本地接口地址,初始化 IPv6MulticastOption 类的新实例。Initializes a new instance of the IPv6MulticastOption class with the specified IP multicast group and the local interface address.

属性

Group

获取或设置多路广播组的 IP 地址。Gets or sets the IP address of a multicast group.

InterfaceIndex

获取或设置与多路广播组关联的接口索引。Gets or sets the interface index that is associated with a multicast group.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于