读取OS版本C#

发布于 2025-01-21 21:10:36 字数 352 浏览 5 评论 0原文

我正在尝试使用.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2025-01-28 21:10:36

最后一组数字称为“更新构建修订版”(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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文