【问题标题】:Need an alternative to Mobile Broadband API in WinRT需要 WinRT 中移动宽带 API 的替代方案
【发布时间】:2015-04-10 06:25:22
【问题描述】:

我正在尝试使用移动宽带 API 接口在 Windows RT 平板电脑上获取移动设备信息,例如 IMEI 等。
You can find the API reference here

我打算创建一个控制台应用程序来检索信息,如下面的示例所示。但是我在 WinRT 中找不到 MbnApi 命名空间。

我知道它在 WinRT 中不可用。如果你们中的任何人知道或拥有相同的托管代码或 DLL,请指出正确的方向。

代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MbnApi;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            MbnInterfaceManager mbnInfMgr = new MbnInterfaceManager();
            IMbnInterfaceManager infMgr = (IMbnInterfaceManager)mbnInfMgr;


            MbnConnectionManager mbnConnectionMgr = new MbnConnectionManager();
            IMbnConnectionManager ImbnConnectionMgr = (IMbnConnectionManager)mbnConnectionMgr;


            IMbnConnection[] connections = (IMbnConnection[])ImbnConnectionMgr.GetConnections();
            foreach (IMbnConnection conn in connections)
            {
                IMbnInterface mobileInterface = infMgr.GetInterface(conn.InterfaceID) as IMbnInterface;
                MBN_INTERFACE_CAPS caps = mobileInterface.GetInterfaceCapability();

                MBN_PROVIDER provider = mobileInterface.GetHomeProvider();
                Console.WriteLine("Device Id :" + caps.deviceID);
                Console.WriteLine("DataClass: " + caps.cellularClass);
                Console.WriteLine("Manufacturer: " + caps.manufacturer);
                Console.WriteLine("Model : " + caps.model);
                Console.WriteLine("Firmware Version: " + caps.firmwareInfo);

            }
            Console.ReadKey(true);
        }
    }
}

【问题讨论】:

  • (我更改了您的问题的标题,以便将来寻找此信息的人更容易找到该问题-希望它能说出您想说的话。)

标签: mobile mobile-broadband-api


【解决方案1】:

如您所说,Windows Mobile Broadband API 仅在 Windows 桌面上可用。

这是您在 Metro/WinRT 区域寻找的内容:Win RT Mobile Broadband APIs.

还有一些关于设备枚举的有用信息,以及您可能需要的其他内容here.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-13
    相关资源
    最近更新 更多