string localIP = String.Empty;

            foreach (IPAddress ip in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
            {
                if (ip.AddressFamily.ToString().ToUpper().Equals("INTERNETWORK"))
                    localIP = ip.ToString();
            }

            return localIP;

+ Recent posts