How can I get all of the IP addresses attached to the machine that my application (C# NET Console app) is running on? I need to bind a WCF service to the primary IP address, and return a list of the full IP address list.
using System.Net;
string myHostName = Dns.GetHostName().ToString();
string ipAddress = Dns.Resolve(HostName).AddressList[0].ToString();
This is what I am using right now to get the Primary IP address, but I can't figure out how to get the rest to return them.
If I bind a WCF service to localhost:8000, will that expose it on the primary?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…