Exemple #1
0
        public static IPAddressSelector Instance()
        {
            if (addressSelector == null)
            {
                addressSelector = new IPAddressSelector();
            }

            return(addressSelector);
        }
Exemple #2
0
 public static string GetLocalIp()
 {
     ///获取本地的IP地址
     //string AddressIP = "127.0.0.1";
     //foreach (IPAddress _IPAddress in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
     //{
     //    if (_IPAddress.AddressFamily.ToString() == "InterNetwork")
     //    {
     //        AddressIP = _IPAddress.ToString();
     //    }
     //}
     //return AddressIP;
     return(IPAddressSelector.Instance().AddressIP);
 }