프로그래밍/.NET2013. 5. 14. 10:19

public string CLIENTIP
{
    get
    {
        System.Net.IPHostEntry host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
        string clientIP = string.Empty;
        for (int i = 0; i < host.AddressList.Length; i++)
        {
            // AddressFamily.InterNetworkV6 - IPv6
            if (host.AddressList[i].AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
            {
                clientIP = host.AddressList[i].ToString();
            }
        }
        return clientIP;
    }
}


Posted by 건깡