0

I need to find the ip address of computer.But i want the IP address of the network,only if connected.The code i used is:

inet = InetAddress.getLocalHost();
String ipadd=inet.getHostAddress();

But I have vmware in my laptop and this code return ip from it.It returns an ip even when i'm not connected to a network and the ip is not 127.0.0.1 .So i checked the interface,it's coming from the vmware.I need it to stop doing that...Please help me out.I really need to finish this soon. Any and all comments will be appreciated :)

sumanth
  • 135
  • 1
  • 10

0 Answers0