-2

How to get List of IP address inside the LAN connection ( Host name + Ip address) in Java ?

need help for the example code.

Suardi_T
  • 1
  • 1

1 Answers1

0

Enter the following code in your application.

Process process = Runtime.getRunTime().execute("net view");
InputStream in=process.getInputStream();

Read all the lines from this input stream and you will get the list of host names in current LAN or WiFi network.

ELITE
  • 5,815
  • 3
  • 19
  • 29