I have the need to know my actual local IP address (i.e. not the loopback address) from a Windows 8 WinRT/Metro app. There are several reasons I need this.
About the accepted answer, you just need this:
HostName localHostName = NetworkInformation.GetHostNames().FirstOrDefault(h =>
h.IPInformation != null &&
h.IPInformation.NetworkAdapter != null);
You can get the local IP Address this way:
string ipAddress = localHostName.RawName; //XXX.XXX.XXX.XXX
Namespaces used:
using System.Linq;
using Windows.Networking;
using Windows.Networking.Connectivity;