title: Get the list of connected machines IP address of lan for Windows Store apps
body: <p>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 <a href="https://stackoverflow.com/questions/14018978/how-to-get-localnetwork-ip-address-for-windowsstore-apps">How to get LocalNetwork IP Address For WindowsStore Apps</a> 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:</p>
  
  <pre><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 &amp;&amp; icp.NetworkAdapter != null)
                      {
                          var hostname =
                              NetworkInformation.GetHostNames().SingleOrDefault(
                                  hn =&gt;
                                  hn.IPInformation != null &amp;&amp;
                                  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();
  
                      }
                  }
              }
          }
  </code></pre>