Get local host IP addresses

zhaozj2021-02-16  75

String strHostname = dns.gethostname ();

Iphostentry iphostentry = DNS.GETHOSTBYNAME (strhostname);

INT NIP = 0;

Foreach (iPaddress ipaddress in iphostentry.addresslist)

{

Console.WriteLine ("IP #" NIP ":"

ipaddress.tostring ());

}

// ----------

DNS.GETOSTBYNAME (DNS.GETHOSTNAME ());

转载请注明原文地址:https://www.9cbs.com/read-12280.html

New Post(0)