Xamarin.Android 获取手机IP地址

命名空间:

using System.Net;

 

代码:

IPAddress[] address = Dns.GetHostAddresses(Dns.GetHostName());


if (address != null && address[0] != null)
{
    string IP = address[0].ToString();
} 

 

posted @ 2018-08-21 14:43  没事儿写个bug  阅读(386)  评论(0编辑  收藏  举报