下面的代码可以检查所用的系统是不是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
//转载请保留此信息