How do I get the IP address of a machine in C#?
My desired answer was
string ipAddress = ""; if (Dns.GetHostAddresses(Dns.GetHostName()).Length > 0) { ipAddress = Dns.GetHostAddresses(Dns.GetHostName())[0].ToString(); }