[Android] 기기에서 IP 가져오기 (NetworkInterface 사용)


[Android] 기기에서 IP 가져오기 (NetworkInterface 사용)

아래와 같이 하면 IPv4 address 를 얻을 수 있습니다.foreach(NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces()) { if(ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet) { Console.WriteLine(ni.Name); foreach (UnicastIPAddressInformation ip in ni.GetIPProperties().UnicastAddresses) { if (ip.Address.AddressFamily == System.Net.Soc..


원문링크 : [Android] 기기에서 IP 가져오기 (NetworkInterface 사용)