コード例 #1
0
        private static void ListAdapterNames(LocalNetworkNode node)
        {
            NetworkAdapter[] entries = node.GetAllAdapters();
            Console.WriteLine("Adapters: ");

            for (int i = 0; i < entries.Length; i++)
            {
                NetworkAdapter entry = entries[i];

                Console.WriteLine(
                    "{0}:\n\tEntry Address: {1}\n\tEntry GUID: {2}\n\tEntry Connected: {3}",
                    i,
                    entry.NetworkAddress,
                    entry.GUID,
                    entry.IsConnected
                    );
            }
        }
コード例 #2
0
 private static NetworkAdapter Find(LocalNetworkNode node, string guid)
 {
     return(node.GetAllAdapters().FirstOrDefault(x => x.GUID.StartsWith(guid)));
 }