如何在Windows Mobile 7上的C#中获取操作系统名称和版本详细信息?

时间:2011-12-12 09:08:34

标签: c# windows-phone-7

如何找到使用Windows Phone os的手机中安装的操作系统名称和操作系统版本。

4 个答案:

答案 0 :(得分:8)

您可以尝试这些链接

http://msdn.microsoft.com/en-us/library/ff941122%28v=VS.92%29.aspx

http://msdn.microsoft.com/en-us/library/microsoft.phone.info.deviceextendedproperties%28v=VS.92%29.aspx

你可以试试这个

   public MainPage()
   {
            InitializeComponent();
            GetDeviceInfo();    
   }    
   public void GetDeviceInfo()
   {
            long ApplicationMemoryUsage = DeviceStatus.ApplicationCurrentMemoryUsage;
            long PeakMemoryUsage = DeviceStatus.ApplicationPeakMemoryUsage;
            string FirmwareVersion = DeviceStatus.DeviceFirmwareVersion;
            string HardwareVersion = DeviceStatus.DeviceHardwareVersion;
            string Manufacturer = DeviceStatus.DeviceManufacturer;
            string DeviceName = DeviceStatus.DeviceName;
            long TotalMemory = DeviceStatus.DeviceTotalMemory;
            string OSVersion = Environment.OSVersion.Version.ToString(); ;
            PowerSource powerSource = DeviceStatus.PowerSource;
            AddToList("Memory Usage :" + ApplicationMemoryUsage);
            AddToList("Peak Memory Usage :" + PeakMemoryUsage);
            AddToList("Firmware Version :" + FirmwareVersion);
            AddToList("Hardware Version :" + HardwareVersion);
            AddToList("Manufacturer :" + Manufacturer);
            AddToList("Total Memory :" + TotalMemory);
            AddToList("Power Source:" + powerSource.ToString());
            AddToList("Operating System: Windows Phone " + OSVersion.ToString());

   }    
   public void AddToList(string Property)
   {
            lstboxDeviceInfo.Items.Add(Property);
   }

在这里查看for more info

答案 1 :(得分:2)

查看DeviceStatus课程。

请查看MSDN

添加 - 在第一次评论后

查看System.Environment

System.Environment.OSVersion

答案 2 :(得分:1)

我认为该版本应该从Environment.OSVersion.Version抓取,我认为您必须将它们与适用的操作系统列表进行比较

  • Windows Mobile 6 5.2
  • Wndows Mobile 5.0 5.1
  • Windows Mobile 2003 SE 4.21 ....

我发现这个article可能有助于确定平台

答案 3 :(得分:0)

使用

怎么样?

Environment.OSVersion

MSDN Article