title: How do I find the local IP address on a Win 10 UWP project
body: <p>I am currently trying to port an administrative console application over to a Win 10 UWP app. I am having trouble with using the System.Net.Dns from the following console code. </p>
  
  <p>How can I get the devices IP</p>
  
  <p>Here is the console app code that I am trying to port over.</p>
  
  <pre><code>public static string GetIP4Address()
  {
      string IP4Address = String.Empty;
      foreach (IPAddress IPA in Dns.GetHostAddresses(Dns.GetHostName()))
      {
          if (IPA.AddressFamily == AddressFamily.InterNetwork)
          {
              IP4Address = IPA.ToString();
              break;
          }
      }
      return IP4Address;
  }
  </code></pre>