问题描述
usingSystem;usingSystem.Net;usingSystem.IO;usingSystem.Data;usingSystem.Text;namespaceCwpSoft.NetIP{publicclassNetIP{staticvoidMain(){Console.WriteLine("您的IP地址是:{0}",System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName()));}}}
解决方案
解决方案二:
解决方案三:
foreach(IPAddressipinDns.Resolve(Dns.GetHostName()).AddressList){Console.WriteLine(ip);}
时间: 2024-10-03 16:02:45