首页 > 代码库 > WPF 获取IP地址

WPF 获取IP地址

             List<string> ipList = new List<string>();            foreach (IPAddress _IPAddress in Dns.GetHostEntry(Dns.GetHostName()).AddressList)            {                if (_IPAddress.AddressFamily.ToString() == "InterNetwork")                {                    ipList.Add(_IPAddress.ToString());                }            }