在我的Windows 7系统上,GetVersionEx Windows API函数返回"6.0",表示Windows Vista,而不是应该返回"6.1"。
如果有关系的话,我使用了以下Delphi代码:
如果有关系的话,我使用了以下Delphi代码:
function winver: string;
var
ver: TOSVersionInfo;
begin
ver.dwOSVersionInfoSize := SizeOf(ver);
if GetVersionEx(ver) then
with ver do
result := IntToStr(dwMajorVersion) + '.' + IntToStr(dwMinorVersion) + '.' + IntToStr(dwBuildNumber) + ' (' + szCSDVersion + ')';
end;
并返回了字符串“6.0.6002(服务包2)”。
这不是非常奇怪吗?