J
Jonathan
Hi,
How can I get the IP address of the local machine using C#?
I tried Dns.GetHostByName(Dns.GetHostName()).AddressList[0];
It always gives 192.168.2.2 which is not I want...
I also tried Dns.Resolve("localhost").AddressList[0];
It only gives the loop back address 127.0.0.1 ...also not I want...
Assume the local machine uses DHCP and don't have DNS name...how can I
get back its current IP address on the Internet?
Thanks!
How can I get the IP address of the local machine using C#?
I tried Dns.GetHostByName(Dns.GetHostName()).AddressList[0];
It always gives 192.168.2.2 which is not I want...
I also tried Dns.Resolve("localhost").AddressList[0];
It only gives the loop back address 127.0.0.1 ...also not I want...
Assume the local machine uses DHCP and don't have DNS name...how can I
get back its current IP address on the Internet?
Thanks!