Windows Store APP- C# to get IP Address
using Windows.Networking.Connectivity; public String GetIPString() { String ipString = String.Empty; var icp = NetworkInformation.GetInternetConnectionProfile(); if (icp != null && icp.NetworkAdapter != null) { var hostname = NetworkInformation.GetHostNames().SingleOrDefault( hn => hn.IPInformation != null && hn.IPInformation.NetworkAdapter != null && hn.IPInformation.NetworkAdapter.NetworkAdapterId == icp.NetworkAdapter.NetworkAdapterId); if (hostname != null) { // the ip address ipString = hostname.CanonicalName; } } return ipString; }
--- Retrieve Host Name.
public static IReadOnlyList<HostName> GetHostNames()