GetOsxNetworkInterfaces() public static method

public static GetOsxNetworkInterfaces ( ) : System.Net.NetworkInformation.NetworkInterface[]
return System.Net.NetworkInformation.NetworkInterface[]
示例#1
0
        private UnicastIPAddressInformationCollection GetUnicastAddresses()
        {
            UnicastIPAddressInformationCollection collection = new UnicastIPAddressInformationCollection();

            foreach (UnicastIPAddressInformation info in
                     OsxNetworkInterface.GetOsxNetworkInterfaces().SelectMany(oni => oni.GetIPProperties().UnicastAddresses))
            {
                // PERF: Use Interop.Sys.EnumerateInterfaceAddresses directly here.
                collection.InternalAdd(info);
            }

            return(collection);
        }