如何使用我的应用程序在Windows Phone 8中获得设计型号 [英] How to get devise model number in windows phone 8 using my application

查看:64
本文介绍了如何使用我的应用程序在Windows Phone 8中获得设计型号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用我的应用程序在Windows Phone 8中获得设计型号,

How to get devise model number in windows phone 8 using my application, 

推荐答案

我想您想要的格式为< Manufacturer> <模型>但是诺基亚只有其内部名称为DeviceName,因此您需要制定自制解决方案,我在一个项目中创建了该解决方案:

I suppose you want in the form <Manufacturer><Model> but Nokia only have their internal names as DeviceName so you need to make a homebrew solution, I created this in a project:

public static string Model
{
   get
   {
      string manufacturer = DeviceStatus.DeviceManufacturer;
      string model = string.Empty;
      if (manufacturer.Equals("NOKIA"))
      {
         model = manufacturer + " ";
         string name = DeviceStatus.DeviceName.Substring(0, 6);
         switch (name)
         {
            case "RM-846":
               model += "Lumia 620";
               break;
            case "RM-878":
               model += "Lumia 810";
               break;
            case "RM-824":
            case "RM-825":
            case "RM-826":
               model += "Lumia 820";
               break;
            case "RM-845":
               model += "Lumia 822";
               break;
            case "RM-820":
            case "RM-821":
            case "RM-822":
               model += "Lumia 920";
               break;
            case "RM-867":
               model += "Lumia 920T";
               break;
         }
      }
      else if (manufacturer.Equals("HTC"))
      {
         string[] partModel = DeviceStatus.DeviceName.Split(' ');
         model = manufacturer + " " + partModel[2];
      }
      else if (manufacturer.Equals("Huawei"))
      {
         //Huawei Ascend W1 (untested)
         model = DeviceStatus.DeviceName;
      }
      else if (manufacturer.Equals("Samsung"))
      {
         //Samsung Ativ S, Samsung Ativ Odyssey (untested)
         model = DeviceStatus.DeviceName;
      }
      return model;
   }
}



这篇关于如何使用我的应用程序在Windows Phone 8中获得设计型号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆