The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
[W10M][UWP App] How to get the Windows Version? RRS feed

  • Question

  • Hi.

    I want get current Windows Version (ex 10.1.10586.336)

    I using the c# application.

    How to get the Windows version on my device?

    Please let me know.

    Thanks.

    Jack.

    Tuesday, June 7, 2016 9:02 AM

Answers

  • Please do not use the Windows version to check if some future is available, this will break your app in the next version of Windows!

    cschotte

    • Proposed as answer by Clemens Schotte Wednesday, June 8, 2016 6:43 AM
    • Marked as answer by Barry Wang Thursday, June 16, 2016 7:18 AM
    Wednesday, June 8, 2016 6:43 AM

All replies

  • Hi

    resolved this issue.

    I am using the solution as below 

    .

    String windowsver = AnalyticsInfo.VersionInfo.DeviceFamilyVersion;
                ulong version = ulong.Parse(windowsver);
                ulong major = (version & 0xFFFF000000000000L) >> 48;
                ulong minor = (version & 0x0000FFFF00000000L) >> 32;
                ulong build = (version & 0x00000000FFFF0000L) >> 16;
                ulong revision = (version & 0x000000000000FFFFL);

                //var osVersion = $"(major).(minor).(build).(revision)";
                var osVersion = major + "." + minor + "." + build + "." + revision;

    .

    thanks

    Jack.

    Tuesday, June 7, 2016 9:45 AM
  • Please do not use the Windows version to check if some future is available, this will break your app in the next version of Windows!

    cschotte

    • Proposed as answer by Clemens Schotte Wednesday, June 8, 2016 6:43 AM
    • Marked as answer by Barry Wang Thursday, June 16, 2016 7:18 AM
    Wednesday, June 8, 2016 6:43 AM
  • Hi Clemens

    What's mean?

    This API is will break? from next version of Windows?

    However, how to get the Windows version?

    Please let me know.

    Jack.

    Wednesday, June 8, 2016 7:49 AM
  • @Jack,

    It seems "Clemens Schotte" means don't use Windows version to check whether a feature is available. I think you'd better just use above code for internal usage.

    Best regards,

    Barry


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 10, 2016 8:52 AM