Monday, March 28, 2011

To get the Host Name and IP address in C#

using System.Net;
string getHost = System.Net.Dns.GetHostName();
string getIP = System.Net.Dns.GetHostByName(getHost).AddressList[0].ToString();

No comments:

Post a Comment