如何以编程方式区分Windows 8.1更新与Windows 8.1 [英] how to programmatically distinguish windows 8.1 update from windows 8.1
问题描述
我们有一个系统诊断应用程序,需要从Windows 8.1中区分Windows 8.1更新,但我找不到任何关于如何操作的内容。
We have a system diagnostics application which need to distinguish windows 8.1 update from windows 8.1, but i can not find anything on how to do it.
推荐答案
您仍然可以在Windows 8.1上使用现已弃用的GetVersion(Ex)函数,但您需要在EXE中使用相应的清单才能获得"真实"答案。
You can still use the now deprecated GetVersion(Ex) function on Windows 8.1, but you need to have the appropriate manifest in the EXE to get 'true' answers.
< a href ="http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx"> http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074 .aspx
对于只需要在日志中显示或转储操作系统版本字符串的诊断程序,您可能会发现直接从中获取VERSIONINFO更加强大%WINDIR%\ System32 \ kernel32.dll文件通过
GetFileVersionInfoEx 。这是
一些示例代码,可以帮助您入门。
For a diagnostic program that just needs an OS version string to display or dump in a log, you may find it's more robust to just grab out the VERSIONINFO directly from the %WINDIR%\System32\kernel32.dll file via GetFileVersionInfoEx. Here's some sample code that should get you started.
这篇关于如何以编程方式区分Windows 8.1更新与Windows 8.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!