如何获取运行C#应用程序的服务器的IP地址?
IPHostEntry host;string localIP = "?";host = Dns.GetHostEntry(Dns.GetHostName());foreach (IPAddress ip in host.AddressList){ if (ip.AddressFamily.ToString() == "InterNetwork") { localIP = ip.ToString(); }}return localIP;
LEATH
MMMHUHU
相关分类