Nelson T Joseph
Nelson T Joseph

Reputation: 2763

How can I get OS Name and Version details in C# on windows mobile 7?

How can I find the OS name and os version which is installed in a phone that uses windows phone os.

Upvotes: 4

Views: 8194

Answers (4)

Glory Raj
Glory Raj

Reputation: 17701

you can try these links

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

you can try this

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

take a look at here for more info

Upvotes: 7

Lloyd Powell
Lloyd Powell

Reputation: 18810

Check out the DeviceStatus class.

Have a look at MSDN about it.

Added - after first comment

Check out System.Environment

System.Environment.OSVersion

Upvotes: 2

V4Vendetta
V4Vendetta

Reputation: 38230

I think the version should be grabbed from Environment.OSVersion.Version and i think you will have to compare them to list of operating systems applicable

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

I found this article which might help in determing the platform

Upvotes: 1

codingbadger
codingbadger

Reputation: 44032

What about using

Environment.OSVersion

MSDN Article

Upvotes: 0

Related Questions