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

おっしゃる通り、Windows Mobile Broadband API は Windows デスクトップでのみ使用できます。

Metro/WinRT 分野で探しているものは、 Win RT モバイル ブロードバンド API です。

デバイスの列挙に関する有用な情報や、ここで必要になる可能性のあるその他の情報もあります。

于 2015-04-16T14:45:42.747 に答える