5

I need to get the current OS version of a Windows phone. That is, if it is Windows Phone 7.0 or 7.1, so that I have to write code supporting for both OS versions. I have to run my app in both 7.0 and 7.1.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Sujiz
  • 1,720
  • 1
  • 20
  • 30

2 Answers2

13

you can get the OS Major and minor version of the phone OS through this following statement

temp = System.Environment.OSVersion.Version.Major
temp = System.Environment.OSVersion.Version.Minor

in both the WP 7.0 and 7.1 major version is 7 but Minor version differs. For Wp7.0 it is 0 and 7.1 it is 10

Santhu
  • 1,535
  • 8
  • 11
3

Use System.Environment.OSVersion.Version

Claus Jørgensen
  • 25,882
  • 9
  • 87
  • 150
  • but if is use this code i get the output as Microsoft Windows NT 5.1.2600.0 but i want to get the os version.is there any code to get the out put as 7.0 or 7.1 ? – Sujiz Dec 01 '11 at 12:10