0

I am working on a JAVA project to list out all available Wi-FI interfacesand their network interfaces name.

this is my code:

Enumeration<NetworkInterface> a = NetworkInterface.getNetworkInterfaces();
    while (a.hasMoreElements()) {
          NetworkInterface ni = a.nextElement();
          if(ni.isUp()) {
               System.out.println(ni.getName());
          }
        }

This code returns all network interfaces including Wi-Fi interface:

lo
wlan0

But I want to get also the Wi-Fi interfcae name like this:

netowrk interface: "wlan0"
Wi-Fi name: "Wi-Fi"

netowrk interface: "wlan1"
Wi-Fi name: "Wi-Fi 1"
Zak FST
  • 361
  • 3
  • 6
  • 17

0 Answers0