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

Tibco Rendezvous (tibrv) C# .Net example

Parse XML to dynamic object in C#