i want retrieve all local ip addresses which is connected to network...
I am doing this by following code
private string GetLocalIP()
{
IPHostEntry host;
string localip = "?";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach( IPAddress ip in host.AddressList)
{
if(ip.AddressFamily== AddressFamily.InterNetwork)
{
localip = ip.ToString();
listBoxIPS.Items.Add(localip);
return ip.ToString();
}
} return "127.0.0.1";
}
but it retrieves only my local ip address not others please help me how to get other local ip addresses thank you..