How to get the server IP Address?

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);

Leave a comment

Send a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.