using System.Net.NetworkInformation;
private string GetMacAddress()
{
string macAddresses = "";
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
{
// only consider Ethernet network interfaces, thereby ignoring any
// loopback devices etc.
if (nic.NetworkInterfaceType != NetworkInterfaceType.Ethernet)
continue;
if (nic.OperationalStatus == OperationalStatus.Up)
{
macAddresses += nic.GetPhysicalAddress().ToString();
break;
}
}
return macAddresses;
}
'C#' 카테고리의 다른 글
[C#/PDA]무선랜 감도 확인 예제 (0) | 2016.02.16 |
---|---|
[C#/PDA]Zebra EMDK(지브라 PDA) 관련 정보 (0) | 2016.02.15 |
[C#/PDA]DataGrid 컬럼 추가 예제 (0) | 2016.02.11 |
[C#/PDA]DataGrid Row Index 관련 예제 (0) | 2016.02.11 |
[C#]SAP Connector 다운받기 (0) | 2016.02.05 |