Freigeben über


IPv6MulticastOption Konstruktoren

Definition

Initialisiert eine neue Instanz der IPv6MulticastOption-Klasse.

Überlädt

IPv6MulticastOption(IPAddress)

Initialisiert eine neue Version der IPv6MulticastOption-Klasse für die angegebene IP-Multicast-Gruppe.

IPv6MulticastOption(IPAddress, Int64)

Initialisiert eine neue Instanz der IPv6MulticastOption-Klasse mit der angegebenen IP-Multicastgruppe und der angegebenen Schnittstellenadresse.

IPv6MulticastOption(IPAddress)

Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs

Initialisiert eine neue Version der IPv6MulticastOption-Klasse für die angegebene IP-Multicast-Gruppe.

public:
 IPv6MulticastOption(System::Net::IPAddress ^ group);
public IPv6MulticastOption (System.Net.IPAddress group);
new System.Net.Sockets.IPv6MulticastOption : System.Net.IPAddress -> System.Net.Sockets.IPv6MulticastOption
Public Sub New (group As IPAddress)

Parameter

group
IPAddress

Die IPAddress der Multicastgruppe.

Ausnahmen

group ist null.

Beispiele

Im folgenden Beispiel wird ein IPv6MulticastOption -Objekt erstellt.

// 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() + "]"))

Gilt für:

IPv6MulticastOption(IPAddress, Int64)

Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs
Quelle:
MulticastOption.cs

Initialisiert eine neue Instanz der IPv6MulticastOption-Klasse mit der angegebenen IP-Multicastgruppe und der angegebenen Schnittstellenadresse.

public:
 IPv6MulticastOption(System::Net::IPAddress ^ group, long ifindex);
public IPv6MulticastOption (System.Net.IPAddress group, long ifindex);
new System.Net.Sockets.IPv6MulticastOption : System.Net.IPAddress * int64 -> System.Net.Sockets.IPv6MulticastOption
Public Sub New (group As IPAddress, ifindex As Long)

Parameter

group
IPAddress

Die Gruppen-IPAddress.

ifindex
Int64

Die lokale Schnittstellenadresse.

Ausnahmen

ifindex ist kleiner als 0.

- oder -

ifindex ist größer als 0x00000000FFFFFFFF.

group ist null.

Beispiele

Im folgenden Beispiel wird ein IPv6MulticastOption -Objekt erstellt.

// Instantiate IPv6MulticastOption using another
// overloaded constructor.
IPv6MulticastOption^ ipv6MulticastOption2 = gcnew IPv6MulticastOption( group,interfaceIndex );

// Store the IPAdress multicast options.
group = ipv6MulticastOption2->Group;
interfaceIndex = ipv6MulticastOption2->InterfaceIndex;

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

// Join the specified multicast group using one of the
// JoinMulticastGroup overloaded methods.
clientOriginator->JoinMulticastGroup( (int)interfaceIndex, group );

// Instantiate IPv6MulticastOption using another
// overloaded constructor.
IPv6MulticastOption ipv6MulticastOption2 = new IPv6MulticastOption(group, interfaceIndex);

// Store the IPAdress multicast options.
group =  ipv6MulticastOption2.Group;
interfaceIndex = ipv6MulticastOption2.InterfaceIndex;

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

// Join the specified multicast group using one of the
// JoinMulticastGroup overloaded methods.
clientOriginator.JoinMulticastGroup((int)interfaceIndex, group);
' Instantiate IPv6MulticastOption using another 
' overloaded constructor.
Dim ipv6MulticastOption2 As New IPv6MulticastOption(group, interfaceIndex)

' Store the IPAdress multicast options.
group = ipv6MulticastOption2.Group
interfaceIndex = ipv6MulticastOption2.InterfaceIndex

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

' Join the specified multicast group using one of the 
' JoinMulticastGroup overloaded methods.
clientOriginator.JoinMulticastGroup(Fix(interfaceIndex), group)

Hinweise

Der ifindex Parameter gibt die Schnittstelle an, über die Daten empfangen oder gesendet werden.

Gilt für: