使用 Java 扫描并连接到 Wifi 网络

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12517765/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 09:12:31  来源:igfitidea点击:

Scan and connect to Wifi networks using Java

javanetwork-programmingwifinetwork-scan

提问by user1686758

Need to write a client, which can scan the available WIFI networks and connects to best known using Java. This might be desktop client which does this job. Any pointers would be helpful and appreciate your response.

需要编写一个客户端,它可以扫描可用的WIFI网络并使用Java连接到最著名的。这可能是完成这项工作的桌面客户端。任何指示都会有所帮助,并感谢您的回应。

回答by Jon Lin

You'll have to rely on a JNI library since you can't access a wireless device directly in Java.

您将不得不依赖 JNI 库,因为您无法直接使用 Java 访问无线设备。

jWlanScanfor Windows.

适用于 Windows 的jWlanScan

回答by Johnny

I suggest you to act upon your operating system. And for each of the supporting operating system try to analyse the results of the command lines needed to connect the wireless devices. It is quite straight forward and You will not have to work with JNI libraries.

我建议您根据您的操作系统采取行动。并针对每个支持的操作系统尝试分析连接无线设备所需的命令行的结果。它非常简单,您不必使用 JNI 库。

For example for windows you can see the ones introduced here, hereand hereand for the linux it is still easier.

例如,对于 windows,您可以看到这里介绍的内容herehere,对于 linux,它仍然更容易。