获取IP地址:

1         private static IPAddress GetIP()
2         {
3             IPHostEntry ipHost = Dns.GetHostEntry(Dns.GetHostName());
4             IPAddress ipaddress = ipHost.AddressList.FirstOrDefault(x => x.AddressFamily == AddressFamily.InterNetwork);//IP 版本 4 的地址。IP 版本 6 的地址使用InterNetworkV6
5             return ipaddress;
6         }

 

相关文章:

  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-25
  • 2022-02-18
  • 2021-10-21
  • 2022-02-23
  • 2022-12-23
相关资源
相似解决方案