public string GetIP()
{

IPAddress[] ips = Dns.GetHostAddresses(Dns.GetHostName());
//txtlocalIP.Text = ips[0].ToString();
IPAddress ip = IPAddress.Parse("127.0.0.1");
foreach (IPAddress ipa in ips)
{
if (ipa.AddressFamily == AddressFamily.InterNetwork)
{
ip = ipa;
break;
}
}
string IPAdd = Convert.ToString(ip);
return IPAdd;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2021-08-14
  • 2021-10-01
  • 2022-01-28
  • 2022-02-02
相关资源
相似解决方案