This CSharp (C#) code snippet shows how to get the IP address of the machine.

 

private void ListIPAddresses()
{
    IPHostEntry myIPHostEntry = Dns.GetHostEntry(Dns.GetHostName());

    foreach (IPAddress myIPAddress in myIPHostEntry.AddressList)
    {
        Console.WriteLine(myIPAddress.ToString());    
    }
}
Cookies make it easier for us to provide you with our services. With the usage of our services you permit us to use cookies.
More information Ok