如何枚举范围内所有可用的Wifi网络? [英] how to enumerate all available Wifi networks at range?

查看:196
本文介绍了如何枚举范围内所有可用的Wifi网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在谷歌上看到这是不可能的,而在OS 2.0上,有一些无证件的Api可以实现这一点,但随后你的应用程序将被拒绝....

I read on google that this is not possible, and that on OS 2.0, it was some undocumented Api to accomplish that, but then your app will got rejected ....

我们几乎都在操作系统4.0上....关于这个的任何消息?

we are almosto on OS 4.0....any news regarding this?

推荐答案

有2.0之前的解决方案可以在互联网上找到。其中一个似乎如下:

There are pre-2.0 solutions to be found on the Internet. One of them seems to be as follows:

void *libHandle;
void *airportHandle;
int (*open)(void *);
int (*bind)(void *, NSString *);
int (*close)(void *);

libHandle = dlopen("/System/Library/Frameworks/Preferences.framework/Preferences", RTLD_LAZY);
open = dlsym(libHandle, "Apple80211Open");
bind = dlsym(libHandle, "Apple80211BindToInterface");
close = dlsym(libHandle, "Apple80211Close");

open(&airportHandle);
bind(airportHandle, CFSTR("en0"));
close(&airportHandle);

dlclose(libHandle);

我不确定访问此框架是否不受限制。但是运行它会导致EXC_BAD_ACCESS。所以要么代码错了,框架已经改变,要么以某种方式被锁定。请原谅我任何明显的Objective-C faux-pas。我从星期四开始只讲Objective-C,所以我的Objective-C流畅性可能就像是将拉丁语演员跳伞到敌对的特兰西瓦尼亚山区。

I'm not sure if accessing this framework is off limits. But running it causes a EXC_BAD_ACCESS. So either the code is wrong, the framework has changed or it's somehow locked. Forgive me for any obvious Objective-C faux-pas. I've only been speaking Objective-C since Thursday, so my Objective-C fluency is probably like parachuting a latin speaker into a hostile Transylvanian mountian region.

这篇关于如何枚举范围内所有可用的Wifi网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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