获取 SIM MSISDN &Windows Phone 应用程序中的 IMSI 号码 [英] Get SIM MSISDN & IMSI number in Windows Phone Application
问题描述
是否可以获取 SIM MSISDN &Windows Phone 应用开发中的 IMSI 号码?
我已经完成了一些问答,但很久以前就有人问过了.
您可以获得 SIM MSISDN &Windows Phone 应用程序中的 IMSI 号码.请注意,您应该手动编辑您的应用程序 Package.appxmanifest,如下所示:
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"IgnorableNamespaces="uap mp rescap">......<能力><rescap:Capability Name="cellularDeviceIdentity"/></能力>
<块引用>
cellularDeviceIdentity 功能允许应用访问蜂窝识别数据.任何人都可以请求访问这些 功能 用于商店提交.
您可以使用 MobileBroadbandModem
类获取所有CurrentDeviceInformation
,下面是核心代码.
使用 Windows.Networking.NetworkOperators;......public IReadOnlyList获取SimCards(){var 结果 = new List();var modem = MobileBroadbandModem.GetDefault();如果(调制解调器==空){返回 results.AsReadOnly();}var account = modem.CurrentAccount;如果(帐户 == 空){返回 results.AsReadOnly();}var simCard = new SimCard();simCard.ICCID = account.CurrentDeviceInformation.SimIccId;simCard.IMSI = account.CurrentDeviceInformation.SubscriberId;simCard.MSISDN = modem.DeviceInformation.TelephoneNumbers;simCard.MCC = ExtractMCC(simCard.IMSI);simCard.MNC = ExtractMNC(simCard.IMSI);simCard.MSID = ExtractMSID(simCard.IMSI);结果.添加(simCard);返回 results.AsReadOnly();}
我已将代码示例上传到 git hub.请检查!
Is it possible to get the SIM MSISDN & IMSI number in windows Phone app development?
I have gone through some of the Q/A but they all are asked a long time ago.
You could get SIM MSISDN & IMSI number in Windows Phone Application. Please notice that you should manually edit your application Package.appxmanifest as follows:
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp rescap">
......
<Capabilities>
<rescap:Capability Name="cellularDeviceIdentity" />
</Capabilities>
The cellularDeviceIdentity capability allows apps to access cellular identification data. Anyone may request access to these capabilities for store submission.
You could use MobileBroadbandModem
class to get all CurrentDeviceInformation
, and the following is core codes.
using Windows.Networking.NetworkOperators;
......
public IReadOnlyList<SimCard> GetSimCards()
{
var results = new List<SimCard>();
var modem = MobileBroadbandModem.GetDefault();
if (modem == null)
{
return results.AsReadOnly();
}
var account = modem.CurrentAccount;
if (account == null)
{
return results.AsReadOnly();
}
var simCard = new SimCard();
simCard.ICCID = account.CurrentDeviceInformation.SimIccId;
simCard.IMSI = account.CurrentDeviceInformation.SubscriberId;
simCard.MSISDN = modem.DeviceInformation.TelephoneNumbers;
simCard.MCC = ExtractMCC(simCard.IMSI);
simCard.MNC = ExtractMNC(simCard.IMSI);
simCard.MSID = ExtractMSID(simCard.IMSI);
results.Add(simCard);
return results.AsReadOnly();
}
I have uploaded code sample to git hub. Please check!
这篇关于获取 SIM MSISDN &Windows Phone 应用程序中的 IMSI 号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!