相关疑难解决方法(0)

如何在iPhone上获取WIFI网关地址?

我需要获取与iPhone连接的wifi网络的网关地址.谁知道怎么做到这一点?

只是为了澄清,我正在寻找这个屏幕的信息:

在此输入图像描述

谢谢.

iphone networking

15
推荐指数
3
解决办法
4万
查看次数

Objective-C:如何获取路由器地址?

我试着以这种方式获取路由器地址.

- (NSString *) routerIp {

  NSString *address = @"error";
  struct ifaddrs *interfaces = NULL;
  struct ifaddrs *temp_addr = NULL;
  int success = 0;

  // retrieve the current interfaces - returns 0 on success
  success = getifaddrs(&interfaces);
  if (success == 0)
  {
    // Loop through linked list of interfaces
    temp_addr = interfaces;
    while(temp_addr != NULL)
    {
      if(temp_addr->ifa_addr->sa_family == AF_INET)
      {
        // Check if interface is en0 which is the wifi connection on the iPhone
        if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"])
        {
          // Get …
Run Code Online (Sandbox Code Playgroud)

iphone router objective-c ip-address

7
推荐指数
2
解决办法
2万
查看次数

如何确定iPhone上的默认网关?

我需要在iPhone应用程序中获取默认网关的IP地址.我找不到合适的API.有人知道iPhone是否公开了这些信息?

iphone objective-c

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

iphone ×3

objective-c ×2

ip-address ×1

networking ×1

router ×1