var hostNamesList = NetworkInformation.GetHostNames();
HostName serverHost = new HostName("cptdomain.ctl.local");
StreamSocket clientSocket = new Windows.Networking.Sockets.StreamSocket();
// Try to connect to the remote host
await clientSocket.ConnectAsync(serverHost, "http");
foreach (var entry in hostNamesList)
if (entry.Type == HostNameType.DomainName)
hostName.Text = "Machine Name : " + entry.DisplayName;
IPAddress.Text = "Machine IP : " + clientSocket.Information.LocalAddress.DisplayName;
ServerAddress.Text = "Server IP : " + clientSocket.Information.RemoteAddress.DisplayName;
But actually my requirement is, how to get the list of IP addresses and name of the computers that are connected to the server in LAN for Windows Store Apps.
Please guide me in this to get the proper solution for running my store app.
Note: Here I was working with windows8 store apps with WinRT
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)