标签:
导入头文件:
#import <SystemConfiguration/CaptiveNetwork.h>
- (void)currentWifiSSID {
// Does not work on the simulator.
NSArray *ifs = (__bridge id)CNCopySupportedInterfaces();
NSLog(@"ifs:%@",ifs);
for (NSString *ifnam in ifs) {
NSDictionary *info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam);
NSLog(@"dici:%@",[info allKeys]);
if (info[@"BSSID"]) {
ramcstr = info[@"BSSID"];
NSLog(@"%@",ramcstr);
}
if (info[@"SSID"]) {
rssidstr = info[@"SSID"];
NSLog(@"%@",rssidstr);
}
if (info[@"SSIDDATA"]){
SSIDDATAstr = info[@"SSIDDATA"];
NSLog(@"%@",SSIDDATAstr);
}
}
}
标签:
原文地址:http://www.cnblogs.com/z-j-w/p/4313981.html