Is there any way to fetch Mobile Number of windows phone 10 using c#

泪湿孤枕 提交于 2019-12-22 17:33:40

问题


I have created my application in UWP. I need to search current sim and sim Mobile number. Please help me for find the mobile number using windows phone 10 in c#


回答1:


Yes, it is possible. You can use SmsDevice2.AccountPhoneNumber to get the phone number. From this article,Pay attention of

This functionality is only available to mobile operator apps and Windows Store apps given privileged access by mobile network operators, mobile broadband adapter IHV, or OEM.

Hence it requires the cellularMessaging capability, a special-use capability, to be declared in the package manifest, so this kind of app can’t be published in Windows Store for normal developer

A relative sample of SMS you can reference SMS send and receive sample.




回答2:


You can't get the phone number from the device, whatever its type was, for a simple reason, that the mobile phone number is not stored on the SIM Card.

SIM Card holds contacts, SMSs, and network information along with an ID to link this SIM card to the User phone number.

so, don't try u will not get it from the SIM, but if it was stored manually in the device anyway else, you can get it then.



来源:https://stackoverflow.com/questions/45104594/is-there-any-way-to-fetch-mobile-number-of-windows-phone-10-using-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!