Actually I tried to get the list of Ip Addresses of the LAN for Windows Store Apps using Xaml and C#. Can Any one Please tell me how to do this and referred this link How to get LocalNetwork IP Address For WindowsStore Apps but it is showing the local machine Ip address but I want the list of connected host names and Ip addresses which are connected to the local server in LAN. Here is my code:
var hostNamesList = Windows.Networking.Connectivity.NetworkInformation
.GetHostNames();
foreach (var entry in hostNamesList)
{
if (entry.Type == Windows.Networking.HostNameType.DomainName)
{
var icp = NetworkInformation.GetInternetConnectionProfile();
if (icp != null && icp.NetworkAdapter != null)
{
var hostname =
NetworkInformation.GetHostNames().SingleOrDefault(
hn =>
hn.IPInformation != null &&
hn.IPInformation.NetworkAdapter.NetworkAdapterId ==
icp.NetworkAdapter.NetworkAdapterId);
MessageDialog msg = new MessageDialog(hostname.CanonicalName);
await msg.ShowAsync();
MessageDialog msg1 = new MessageDialog(entry.RawName);
await msg1.ShowAsync();
}
}
}
}