用Java获取无线网络的SSID和其他信息 [英] Getting SSID and other information of a wireless network in Java

查看:35
本文介绍了用Java获取无线网络的SSID和其他信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Java 获取无线网络设备的 SSID.我试过官网教程http://java.sun.com/docs/books/tutorial/networking/nifs/retrieving.html 但 getDisplayName() getName() 不返回 SSID.有没有办法获得确切的 SSID?此外,我还试图读取我所有网络设备的 wifi 信号强度,但找不到方法.任何人都可以指导我从哪里获取所有这些信息(教程、代码示例等)?

I'm trying to get the SSID of my wireless network device in Java. I tried the official network tutorials http://java.sun.com/docs/books/tutorial/networking/nifs/retrieving.html but getDisplayName() getName() don't return SSID. Is there a way to get an exact SSID? Also, I'm also trying to read the wifi signal strength of all my network devices and couldn't find a way to do it. Can anyone please direct me from where to get all these information (tutorials, code samples etc)?

谢谢

推荐答案

这无法使用纯 Java 来完成.Java API 可以带您低至 NetworkInterface 网络堆栈中的级别,但不低于此级别.当连接到 WiFi 网络时,所有 SSID、握手和安全工作都在比这更低的级别完成 - 即您的平台相关驱动程序.Java API(从 Java7 开始)不会让您更接近这些信息;为此,您将不得不使用一些与平台相关的代码.

This cannot be done using pure Java. The Java API can take you as low as the NetworkInterface level in the networking stack, but not lower. When connected to a WiFi network, all SSID, handshaking and security stuff is done in lower levels than that - namely, your platform-dependent driver. The Java API (as of Java7) doesn't let you any closer to this information; you will have to use some platform-dependent code for that.

这篇关于用Java获取无线网络的SSID和其他信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆