Answers for "c# list local ip addresses"

C#
0

c# list local ip addresses

using System;
using System.Net;

namespace Reverse
{
    class Program
    {
        static void Main(string[] args)
        {
            string ComputerName = Dns.GetHostName();
            IPAddress[] localIPs = Dns.GetHostAddresses(ComputerName);
            foreach(IPAddress ip in localIPs)
            {
                Console.WriteLine(ip.ToString());
            }
        }
    }
}
Posted by: Guest on February-26-2021

Code answers related to "c# list local ip addresses"

C# Answers by Framework

Browse Popular Code Answers by Language