none
wp8可以得到AP的mac地址吗? RRS feed

  • 问题

  • 是用共有API,可以上架的。
    分两种情况:1,得到已联接的AP的MAC;
    2,得到周围全部AP的MAC。
    2014年4月28日 8:01

答案

  • 你好,

    Windows Phone 8中,暂时还没有这样的API,建议到: http://visualstudio.uservoice.com/forums/121579-visual-studio 上去提一个Feature Request。另外我们也会通过内部途径上报给微软。

    这里有一个变通方案:

            public static void ShowNetworkInterfaces()
            {
                Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceList InterfacesList = new Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceList();
                foreach (Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceInfo specificInterface in InterfacesList)
                {
                    if (specificInterface.InterfaceType == Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.Wireless80211)
                    {
                        Console.WriteLine("This interface is a Wifi Interface :");
                    }
    
                    Console.WriteLine("Bandwidth :" + specificInterface.Bandwidth);
                    Console.WriteLine("Characteristics :" + specificInterface.Characteristics);
                    Console.WriteLine("Description :" + specificInterface.Description);
                    Console.WriteLine("InterfaceName :" + specificInterface.InterfaceName);
                    Console.WriteLine("InterfaceType :" + specificInterface.InterfaceType);
                }
            }

    你可以使用Description作为惟一的标识。具体信息请参考:NetworkInterfaceInfo Class

    希望我的回复可以帮助你。

    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年4月29日 9:44
    版主
  • 你好,

    是这样的。只能获得周边WiFi信息,没有办法获得MAC地址。

    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • 已标记为答案 suduan 2014年5月4日 9:46
    2014年5月4日 9:31
    版主

全部回复

  • 你好,

    Windows Phone 8中,暂时还没有这样的API,建议到: http://visualstudio.uservoice.com/forums/121579-visual-studio 上去提一个Feature Request。另外我们也会通过内部途径上报给微软。

    这里有一个变通方案:

            public static void ShowNetworkInterfaces()
            {
                Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceList InterfacesList = new Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceList();
                foreach (Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceInfo specificInterface in InterfacesList)
                {
                    if (specificInterface.InterfaceType == Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.Wireless80211)
                    {
                        Console.WriteLine("This interface is a Wifi Interface :");
                    }
    
                    Console.WriteLine("Bandwidth :" + specificInterface.Bandwidth);
                    Console.WriteLine("Characteristics :" + specificInterface.Characteristics);
                    Console.WriteLine("Description :" + specificInterface.Description);
                    Console.WriteLine("InterfaceName :" + specificInterface.InterfaceName);
                    Console.WriteLine("InterfaceType :" + specificInterface.InterfaceType);
                }
            }

    你可以使用Description作为惟一的标识。具体信息请参考:NetworkInterfaceInfo Class

    希望我的回复可以帮助你。

    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年4月29日 9:44
    版主
  • 谢谢。

    再确认一下,就采纳。

    上面的代码是手机可以检测到的周边所有wifi的信息,就是没有mac,对吧。

    还有即使是已经连接上的wifi,也是无法得到wifi的mac,只能得到上述的信息。对吧?

    2014年5月4日 3:47
  • 你好,

    是这样的。只能获得周边WiFi信息,没有办法获得MAC地址。

    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • 已标记为答案 suduan 2014年5月4日 9:46
    2014年5月4日 9:31
    版主