0

我正在尝试使用移动宽带 API 接口在 Windows RT 平板电脑上获取移动设备信息,例如 IMEI 等。
您可以在此处找到 API 参考

我打算做一个控制台应用程序来检索信息,如下面的示例所示。但我无法在 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);
        }
    }
}
4

1 回答 1

0

As you say, Windows Mobile Broadband API is only available on the Windows Desktop.

Here's what you're looking for in the Metro/WinRT area: Win RT Mobile Broadband APIs.

There is also some useful information about device enumeration, and other things you might need here.

于 2015-04-16T14:45:42.747 回答