CSharp examples for Network:IP Address
Get Mac Address List
// All Rights Reserved , Copyright (C) 2012 , Hairihan TECH, Ltd. using System.Net.NetworkInformation; using System.Net; using System.Management; using System.Collections.Generic; public class Main{ public static List<string> GetMacAddressList() {/* www . j a v a2 s. c o m*/ List<string> macAddressList = new List<string>(); NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface ni in networkInterfaces) { if (!ni.Description.Contains("WiFi") && !ni.Description.Contains("Loopback") && !ni.Description.Contains("VMware") && ni.OperationalStatus == OperationalStatus.Up) { macAddressList.Add(ni.GetPhysicalAddress().ToString()); } } return macAddressList; } }