Code Snippets

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

This CSharp (C#) code snippet shows how to get the external IP address (IPv4) of a machine (i.e. dialup connection IP). To achieve this we get all ip addresses of the machine and compare them against the local address ranges (10.0.0.0/24, 172.16.0.0/16, 192.168.0.0/16 and 169.254.0.0/16).