Home > Mobile >  Reading OS Version C#
Reading OS Version C#

Time:04-19

I'm trying to get my os version using VersionString on .NET5. Here's the code (I found such an example somewhere on the internet).

string osVersion = Environment.OSVersion.VersionString;
Console.WriteLine("OS Version: "   osVersion);

The result is OS Version: Microsoft Windows NT 10.0.19043.0 However, I'm sure whether this is the correct result because my current OS version according to AIDA64 Business is 10.0.19043.1526. So I was wondering why the output of my program is 0 instead of 1526? Or mayde it doesn't matter?

CodePudding user response:

The last set of digits is called the Update Build Revision (UBR) and can be accessed from the registry at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UBR

  • Related