[C#] 取得IP地址 →→→→→进入此内容的聊天室

来自 , 2019-03-28, 写在 C#, 查看 116 次.
URL http://www.code666.cn/view/4ef30115
  1. using System;
  2. using System.Net;
  3.  
  4. class GetIP
  5. {
  6. public static void Main()
  7. {
  8. IPHostEntry ipEntry = Dns.GetHostByName (localhost);
  9. IPAddress [] IpAddr = ipEntry.AddressList;
  10. for (int i = 0; i < IpAddr.Length; i++)
  11. {
  12. Console.WriteLine (IP Address {0}: {1} , i, IpAddr.ToString ());
  13. }
  14. }
  15. }
  16.  
  17. //csharp/1105

回复 "取得IP地址"

这儿你可以回复上面这条便签

captcha