IPInterfaceProperties.MulticastAddresses Özellik

Tanım

Bu arabirime atanan çok noktaya yayın adreslerini alır.

C#
public abstract System.Net.NetworkInformation.MulticastIPAddressInformationCollection MulticastAddresses { get; }

Özellik Değeri

MulticastIPAddressInformationCollection Bu arabirimin çok noktaya yayın adreslerini içeren.

Örnekler

Aşağıdaki kod örneği, yerel bilgisayardaki ağ arabirimleri için çok noktaya yayın adreslerini görüntüler.

C#
public static void DisplayMulticastAddresses()
{
    int count = 0;

    Console.WriteLine("Multicast Addresses");
    NetworkInterface[] adapters  = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in adapters)
    {
        IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
        MulticastIPAddressInformationCollection multiCast = adapterProperties.MulticastAddresses;
        if (multiCast.Count > 0)
        {
            Console.WriteLine(adapter.Description);
            foreach (IPAddressInformation multi in multiCast)
            {
                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 addressses were found.");
        Console.WriteLine();
    }
}

Açıklamalar

Çok noktaya yayın adresi birden çok bilgisayarı tanımlar. Çok noktaya yayın adresine gönderilen paketler, adres tarafından tanımlanan tüm bilgisayarlara gönderilir.

Şunlara uygulanır

Ürün Sürümler
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1