In this example, I’ll show How to get local machine ip address using C#
Here is source code of the C# Program to Display the IP Address of the Machine.The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
static void Main()
IPAddress localIPs = Dns.GetHostAddresses(Dns.GetHostName());
foreach (IPAddress addr in localIPs)