현재 로칼 컴퓨터의 아이피 알아내기





using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Diagnostics;
using System;
using System.Linq;
using System.Net;

class Program
{
    public static void Main(string[] args)
    {
        NETNM nmm = new NETNM();
        nmm.RUN();
    }
}
class NETNM
{
    public void RUN()
    {
        var host = Dns.GetHostEntry(Dns.GetHostName());
        foreach (var ip in host.AddressList)
        {
            if (ip.AddressFamily == AddressFamily.InterNetwork)
            {
                Console.WriteLine(ip.ToString());
            }
        }
    }
}

+ Recent posts