string myHost = System.Net.Dns.GetHostName(); // Show the hostname MessageBox.Show(myHost); // Get the IP from the host name
string myIP = System.Net.Dns.GetHostEntry(myHost).AddressList[index].ToString(); // Show the IP MessageBox.Show(myIP);
All technologies, only pure source code
string myHost = System.Net.Dns.GetHostName(); // Show the hostname MessageBox.Show(myHost); // Get the IP from the host name
string myIP = System.Net.Dns.GetHostEntry(myHost).AddressList[index].ToString(); // Show the IP MessageBox.Show(myIP);