NetworkInterface is a Wifi Interface?
How to find wifi network i开发者_StackOverflownterface from the returned result of
NetworkInterface.getNetworkInterfaces();
That information cannot be obtained using Java. You can only retrieve the interface's name and address(es).
Solution for windows 10 (and probably other platforms):
NetworkInterface.getName() returns a name of pattern <interface type>[<index>], where interface type is one of "lo", "wlan", "eth", "ppp", "net". So your interface's name needs to match the regular expression "wlan\d+".
For searching a wifi adapter among the enumeration NetworkInterface.getNetworkInterfaces() you may also filter by NetworkInterface.isUp(), NetworkInterface.isLoopback() .
精彩评论