Skip to main content

PART 5: HOW TO GET IPADDRESS OF A MACHINE|| WINDOWS APPLICATION PROGRAMM...





 class Program
    {
        static void Main(string[] args)
        {
            IPHostEntry host;
            host = Dns.GetHostEntry(Dns.GetHostName());
            foreach(IPAddress ip in host.AddressList)
            {
                if (ip.AddressFamily == AddressFamily.InterNetwork)
                {
                    Console.WriteLine("Your machine IP Address is :"+ip);
                }
                //Console.ReadLine();
            }
            
        }
        
    }

Comments

Popular posts from this blog

Part 12|| Create unique order no || SQL Tutorial|| SQL PROGRAMS|| SQL IN...

PART 19- DELETE RECORD FROM DATATABLE IN MVC || ASP.NET MVC, WEB API, BO...

REMOVE CHARACTERS FROM A STRING || PART 18 || C# TUTORIAL