Get Mac Address C#

0 thích 0 không thích
1 lượt xem
đã hỏi 15 Tháng 12, 2021 trong Lập trình C# bởi nguyenthao (9,000 điểm)
public List<string> GetMacAddress()
        {
            var list = new List<string>();
            foreach (NetworkInterface networkInterface in NetworkInterface.GetAllNetworkInterfaces())
            {
                if (networkInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet && networkInterface.OperationalStatus == OperationalStatus.Up)
                {
                    list.Add(networkInterface.GetPhysicalAddress().ToString());
                }
                   
            }

            return list;
        }
Looking for an answer?  Share this question:     

Xin vui lòng đăng nhập hoặc đăng ký để trả lời câu hỏi này.

...