Groups
Groups
Sign in
Groups
Groups
iOS development
Conversations
About
Send feedback
Help
获得当前连接的wifi名字
36 views
Skip to first unread message
无聊
unread,
Dec 28, 2011, 2:11:42 AM
12/28/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to iOS development
加入SystemConfiguration.framework
加入头文件
#import <SystemConfiguration/CaptiveNetwork.h>
#include <ifaddrs.h>
#include <arpa/inet.h>
获得wifi名字
//ssid
NSString *ssid=nil;
CFDictionaryRef infoDictionary =
CNCopyCurrentNetworkInfo((CFStringRef)@"en0");
if (infoDictionary != nil)
{
ssid = (NSString *)CFDictionaryGetValue(infoDictionary,
kCNNetworkInfoKeySSID);
NSLog(@"route ssid:%@", ssid);
}
需要SDK4.2以上
Reply all
Reply to author
Forward
0 new messages