C# Get server IP address

public static string GetIPAddress(string server)
{
    var host = Dns.GetHostEntry(server);
    if(host.AddressList.Length>0)
    {
        return host.AddressList[0].ToString();
    }
    return null;
}

Comments

Popular posts from this blog

Parse XML to dynamic object in C#

C# Crop white space from around the image