Skip to content

Instantly share code, notes, and snippets.

@kazuakix
Created July 19, 2014 15:00
Show Gist options
  • Save kazuakix/94d7dd0cdd6a32f218e3 to your computer and use it in GitHub Desktop.
Save kazuakix/94d7dd0cdd6a32f218e3 to your computer and use it in GitHub Desktop.
public static void PopulateAdapterList()
{
foreach (Windows.Networking.HostName localHostInfo
in Windows.Networking.Connectivity.NetworkInformation.GetHostNames())
{
if (localHostInfo.IPInformation != null)
{
Debug.WriteLine("Host Name : " + localHostInfo);
Debug.WriteLine("Interface Type : " + localHostInfo.IPInformation.NetworkAdapter.IanaInterfaceType);
Debug.WriteLine("IP Type : " + localHostInfo.Type);
Debug.WriteLine("IP Address : " + localHostInfo.DisplayName);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment