첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.

728x90
반응형
728x170
using System.Net.NetworkInformation;

#region MAC 주소 구하기 - GetMACAddress()

/// <summary>
/// MAC 주소 구하기
/// </summary>
/// <returns>MAC 주소</returns>
public string GetMACAddress()
{
    NetworkInterface[] networkInterfaceArray = NetworkInterface.GetAllNetworkInterfaces();

    foreach(NetworkInterface networkInterface in networkInterfaceArray)
    {
        if(networkInterface.OperationalStatus == OperationalStatus.Up)
        {
            PhysicalAddress physicalAddress = networkInterface.GetPhysicalAddress();

            return physicalAddress.ToString();
        }
    }

    return null;
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요