读取OS版本C#
我正在尝试使用.NET5上的版本播种来获取我的操作系统版本。 这是代码(我在Internet上的某个地方找到了这样的示例)。
string osVersion = Environment.OSVersion.VersionString;
Console.WriteLine("OS Version: " + osVersion);
结果是OS版本:Microsoft Windows NT 10.0.19043.0
但是,我确定这是否是正确的结果,因为我当前的OS版本根据AIDA64业务为10.0.19043.1526。所以我想知道为什么我的程序的输出是0而不是1526?还是Mayde没关系?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后一组数字称为“更新构建修订版”(UBR),可以从注册表访问
hkey_local_machine \ Software \ Software \ Microsoft \ Microsoft \ Windows nt \ currentversion \ ubr
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