C# 取本地计算机名和IP地址

 

using System.Net;

 

string strHostName = Dns.GetHostName(); //计算机名

 

Dns.GetHostName(); //计算机名

Dns.GetHostByName(Dns.GetHostName());//IP地址

相关文章:

  • 2021-07-20
  • 2022-01-03
  • 2021-09-19
  • 2021-12-02
猜你喜欢
  • 2021-06-19
  • 2021-05-26
  • 2021-08-31
  • 2022-12-23
  • 2021-12-21
  • 2021-05-26
相关资源
相似解决方案