有关Windows Phone的信息(型号)

时间:2013-07-02 11:57:46

标签: windows-phone-7 windows-phone-8 windows-phone

我想以编程方式了解设备型号,因为它显示在有关页面about page的设置中

我目前正在使用

Microsoft.Phone.Info.DeviceStatus.DeviceName

但它没有帮助,并给出了一些其他典型的价值。 请帮助我如何获得上述手机型号/名称。

3 个答案:

答案 0 :(得分:7)

你应该使用PhoneNameResolver这个简单的类来解析像

这样的模糊设备名称
  

RM-885_apac_prc_250

成为友好的商业名称,如

  

NOKIA Lumia 720

以下是示例代码:

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

此博文中的更多信息:http://devblog.ailon.org/devblog/post/2013/01/21/Introducing-PhoneNameResolver%E2%80%93a-lib-to-decipher-Windows-Phone-models.aspx

答案 1 :(得分:1)

你可以使用这样的函数: -

        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;
    }

答案 2 :(得分:0)

您可以使用PhoneInfo中的扩展属性检索DeviceName,因此here's the link。测试和工作直到今天;)

享受。