Based on the link provided by Kzest, it looks like there are two ways of accomplishing this. In the examples below, I am screening on AddressFamily to only show items that look like 'xxx.yyy.zz.q'.
Also, the second method also returns the 127.0.0.1 address, which, for my purposes makes it less useful.
private void showIpAddresses()
{
//using System.Net
IPHostEntry hostEntry=Dns.GetHostEntry(Dns.GetHostName());
foreach(IPAddress ipAddress in hostEntry.AddressList)
if(ipAddress.AddressFamily.Equals(System.Net.Sockets.AddressFamily.InterNetwork))
Console.WriteLine(ipAddress.ToString());
}
private void showIpAddresses2()
{
//using System.Net.NetworkInformation
foreach(NetworkInterface nwi in NetworkInterface.GetAllNetworkInterfaces())
{
IPInterfaceProperties ipProperties=nwi.GetIPProperties();
foreach(UnicastIPAddressInformation ipAddress in ipProperties.UnicastAddresses)
if(ipAddress.Address.AddressFamily.Equals(System.Net.Sockets.AddressFamily.InterNetwork))
Console.WriteLine(ipAddress.Address.ToString());
}
}
Either of these meets my needs and answers the question. Thanks to Kzest for pointing me in the right direction.