How To Get IP Address (c#) using asp.net




_______________________________ start _______________________________
     
        string address = string.Empty;

        address = Dns.GetHostName();

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

        foreach (IPAddress hostIP in localip)
        {
            address = hostIP.ToString();
        }

_______________________________ end _______________________________


 result :

address : XXX.XXX.X.XX

Comments

Popular posts from this blog

Tree view in winforms using c#

how to Replace null value with 0 Using C#

how to fetch all HTML Table Records and modify all records accordingly using jquery and Javascript