Reputation: 2763
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
Reputation: 17701
you can try these links
http://msdn.microsoft.com/en-us/library/ff941122%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
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
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
I found this article which might help in determing the platform
Upvotes: 1