IPAddressInformation::Address Property
.NET Framework (current version)
Gets the Internet Protocol (IP) address.
Assembly: System (in System.dll)
The IP address uniquely identifies the interface on the network.
The following code example displays the multicast addresses for the network interfaces on the local computer.
void DisplayMulticastAddresses() { int count = 0; Console::WriteLine( "Multicast Addresses" ); array<NetworkInterface^>^adapters = NetworkInterface::GetAllNetworkInterfaces(); System::Collections::IEnumerator^ myEnum15 = adapters->GetEnumerator(); while ( myEnum15->MoveNext() ) { NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum15->Current); IPInterfaceProperties ^ adapterProperties = adapter->GetIPProperties(); MulticastIPAddressInformationCollection ^ multiCast = adapterProperties->MulticastAddresses; if ( multiCast->Count > 0 ) { Console::WriteLine( adapter->Description ); System::Collections::IEnumerator^ myEnum16 = multiCast->GetEnumerator(); while ( myEnum16->MoveNext() ) { MulticastIPAddressInformation ^ multi = safe_cast<MulticastIPAddressInformation ^>(myEnum16->Current); Console::WriteLine( " Multicast Address ....................... : {0} {1} {2}", multi->Address, multi->IsTransient ? "Transient" : "", multi->IsDnsEligible ? "DNS Eligible" : "" ); count++; } Console::WriteLine(); } } if (count == 0) { Console::WriteLine(" No multicast addresses were found."); Console::WriteLine(); } }
.NET Framework
Available since 2.0
Available since 2.0
Show: