Full width home advertisement

Post Page Advertisement [Top]

How to get all connected local ip address.

String myIP=Inet4Address.getLocalHost().getHostAddress();

for(int i=1;i<=255;i++)
{
int pos=myIP.lastIndexOf(".");
String temp=myIP.substring(0,pos) + "." + i;
System.out.println("IP Address: " +temp);
}


No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib