导入框架CaptiveNetwork

#import <SystemConfiguration/CaptiveNetwork.h>

获取当前连接的wifi信息

// 只能获取当前的SSID
- (id)fetchSSIDInfo
{
NSString *currentSSID = @"";
CFArrayRef myArray = CNCopySupportedInterfaces();
if (myArray != nil){
NSDictionary* myDict = (__bridge NSDictionary *) CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
if (myDict!=nil){
currentSSID=[myDict valueForKey:@"SSID"];
} else {
currentSSID=@"<<NONE>>";
}
} else {
currentSSID=@"<<NONE>>";
} NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();
NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
id info = nil;
for (NSString *ifnam in ifs) {
info = (__bridge id)CNCopyCurrentNetworkInfo((CFStringRef)CFBridgingRetain(ifnam));
if (info && [info count]) {
break;
}
} NSLog(@"wifi info %@",info); return info;
}
wifi info {
BSSID = "a4:2b:8c:92:47:3c";
SSID = "XF-WORLD";
SSIDDATA = <58462d57 4f524c44>;
}

iOS获取当前连接的wifi信息的更多相关文章

  1. iOS 获取已连接的wifi信息

    转:http://blog.csdn.net/marujunyy/article/details/16843173 首先需要   #import <SystemConfiguration/Cap ...

  2. 微信小程序开发(九)获取手机连接的wifi信息

    // succ.wxml <view>WIFI ssid:{{wifissid}}</view> <view>WIFI bssid:{{wifiBssid}}< ...

  3. Android获取当前连接的wifi名称

    首先AndroidMainfest.xml文件里加入权限: <uses-permission android:name="android.permission.ACCESS_NETWO ...

  4. java业务逻辑,利用hibernate获取所连接的数据库信息

    1.本人程序架构是springMVC+hibernate,这次的需求是要针对不同的数据库,做不同的处理. 2.获取所连接的数据库是什么,oracle?  mysql?  sql server?  基础 ...

  5. iOS获取运营商的相关信息

    1.导入:CoreTelephony.framework 2.添加头文件 #import <CoreTelephony/CTTelephonyNetworkInfo.h> #import ...

  6. iOS能否自动扫描周边wifi信息并通过密码连接

    能否获取系统wifi列表信息 不能,只能获取用户当前连接的wifi信息 https://developer.apple.com/forums/thread/112177 https://develop ...

  7. Android 得到当前已连接的wifi的信号强度

    1.得到当前已连接的wifi信息 WifiManager wifi_service = (WifiManager)getSystemService(WIFI_SERVICE); WifiInfo wi ...

  8. WiFi-ESP8266入门http(2-2)文件系统-复杂结构的网页 + 文本框交互WIFI信息

    网友教程:https://blog.csdn.net/solar_Lan/article/details/74231360 通过网友教程,我们搭建了文件系统.在此基础上,我们增加WIFI交互. 现有功 ...

  9. 获取电脑连接WiFi的信息

    在cmd中执行如下命令,即可查看到所有连接过的WiFi信息 for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show ...

随机推荐

  1. Java:反射与代理

    Java世界的繁荣反射这一特性有很大功劳,可以获取全面的类型信息. /** * */ package ref; import java.lang.reflect.Field; import java. ...

  2. let 和 var 区别

    javascript 严格模式 第一次接触let关键字,有一个要非常非常要注意的概念就是”javascript 严格模式”,比如下述的代码运行就会报错: <Javascript 严格模式详解&g ...

  3. WinForm实现Rabbitmq官网6个案例-Publishe/Subscribe

    代码: namespace RabbitMQDemo { public partial class PublishSubscribe : Form { private string exchangeN ...

  4. Java学习笔记(5)----使用正则表达式解决Google Code Jam Qualification2009赛题 Alien Language

    原题地址:https://code.google.com/codejam/contest/90101/dashboard#s=p0 题目描述: Problem After years of study ...

  5. MAVLink Onboard Integration Tutorial

    MAVLink Onboard Integration Tutorial MAVLink is a header-only library, which means that you don't ha ...

  6. Codeforces Round #417 C. Sagheer and Nubian Market

    C. Sagheer and Nubian Market time limit per test  2 seconds memory limit per test  256 megabytes   O ...

  7. VBScript开发Excel常见问题

    VBS基础 基本概念:VB & VBS & VBA VB.VBScript和VBA(Visual Basic For Application)这三种语言,既有联系又有区别.三种语言的语 ...

  8. xfs参数简介

    age_buffer_centisecs age_buffer_centisecs:(Min: 100  Default: 1500  Max: 720000) 多长时间设置为脏数据 xfsbufd_ ...

  9. 线程Event事件

    事件(event) 事件是不同线程之间的同步对象 enent可以通过设置.等待.清除一个标识(flag),来进行线程间的控制 线程可以通过获取这个标志位(flag)的状态(设置或未设置)来控制线程 事 ...

  10. SqlServer 批量添加记录

    declare @i int ) begin INSERT INTO [dbo].[Settlements] ([ID] ,[Count] ,[SettlementDate]) VALUES ( ne ...