information about windows phone (model number)

无人久伴 提交于 2019-12-12 07:16:12

问题


i want to know the device model number programmatically as it is shown in settings about page

i am currently using

Microsoft.Phone.Info.DeviceStatus.DeviceName

but it doesn't help and gives some other typical value. Please help me how can i get phone model/name as above.


回答1:


You should use PhoneNameResolver, a simple class that resolves the obscure devices names like

RM-885_apac_prc_250

into friendlier commercial names like

NOKIA Lumia 720

Here is a sample code:

var phone = PhoneNameResolver.Resolve(
    DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName);
SomeTextBox.Text = phone.FullCanonicalName;

More info in this blog post: http://devblog.ailon.org/devblog/post/2013/01/21/Introducing-PhoneNameResolver%E2%80%93a-lib-to-decipher-Windows-Phone-models.aspx




回答2:


you can use a function like this:-

        public static string getDeviceInfo(bool asList = false)
    {
        string r = "";

        Geolocator locationservice = new Geolocator();

        if (DeviceNetworkInformation.CellularMobileOperator != "") r += "CellularMobileOperator: " + DeviceNetworkInformation.CellularMobileOperator + Environment.NewLine;
        r += "CellularDataEnabled: " + DeviceNetworkInformation.IsCellularDataEnabled + Environment.NewLine;
        r += "WiFiEnabled: " + DeviceNetworkInformation.IsWiFiEnabled + Environment.NewLine;
        r += "IsNetworkAvailable: " + DeviceNetworkInformation.IsNetworkAvailable + Environment.NewLine;
        r += "Hardware Identifier: " + Convert.ToBase64String((byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId")) + Environment.NewLine;
        r += "Location Services Permission: " + locationservice.LocationStatus + Environment.NewLine;

        r += "Language: " + CultureInfo.CurrentCulture.EnglishName + Environment.NewLine;
        r += "Locale: " + CultureInfo.CurrentCulture.Name + Environment.NewLine;
        //r += "Background Service Enabled: " + ScheduledActionService.Find("PeriodicAgent").IsEnabled + Environment.NewLine;
        r += "Runtime Version: " + Environment.Version + Environment.NewLine;
        r += "Maximum Memory: " + (DeviceStatus.DeviceTotalMemory / (1024 * 1024)) + "M" + Environment.NewLine;
        r += "Maximum Memory Available: " + (DeviceStatus.ApplicationMemoryUsageLimit / (1024 * 1024)) + "M" + Environment.NewLine;
        r += "Peak Memory Use: " + (DeviceStatus.ApplicationPeakMemoryUsage / (1024 * 1024)) + "M" + Environment.NewLine;
        r += "Charger: " + DeviceStatus.PowerSource + Environment.NewLine;
        r += "DeviceFirmwareVersion: " + DeviceStatus.DeviceFirmwareVersion + Environment.NewLine;
        r += "DeviceManufacturer: " + DeviceStatus.DeviceManufacturer + Environment.NewLine;
        r += "OS Version: " + Environment.OSVersion + Environment.NewLine;
        r += "User ID: " + settings[KeyString.USER_ID] + Environment.NewLine;
        var phone = PhoneNameResolver.Resolve(DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName);
        r += "Phone model(userfriendly form):" +phone.FullCanonicalName ;
        return r;
    }



回答3:


you can retrieve the DeviceName using extended properties from PhoneInfo, so here's the link. Tested and working til today ;)

Enjoy.



来源:https://stackoverflow.com/questions/17425016/information-about-windows-phone-model-number

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