检测系统是不是windows xp

类别:Delphi 点击:0 评论:0 推荐:

下面的代码可以检查所用的系统是不是windows xp
uses Registry;
...

function IsWinXP: Boolean;
begin
  Result := False;
  if Win32Platform = VER_PLATFORM_WIN32_NT then
    with TRegistry.Create do
    try
      RootKey := HKEY_LOCAL_MACHINE;
      if OpenKeyReadOnly('\Software\Microsoft\Windows NT\CurrentVersion') then
        Result := (ReadString('ProductName') = 'Microsoft Windows XP');
    finally
      Free;
    end;
end;

//rock
//转载请保留此信息

本文地址:http://com.8s8s.com/it/it5722.htm