c# GetLocalIP

private string GetLocalIP()
{
IPHostEntry host;
host = Dns.GetHostEntry(Dns.GetHostName());
string sip = "";
foreach (IPAddress ip in host.AddressList)
{
 
sip +=ip.AddressFamily + " -- > " +  ip.ToString() + Environment.NewLine  ;

}
return sip;
  }

Yorumlar