如何判断系统是Win98、Winme or Win2000,请(20分)

  • 主题发起人 主题发起人 topsuper
  • 开始时间 开始时间
T

topsuper

Unregistered / Unconfirmed
GUEST, unregistred user!
如何用程序判断系统是Win98、Winme or Win2000?
请Gs赤脚
 
uses registry;

function GetWindowsVersion: string;
var
VerInfo: TOsversionInfo;
PlatformId, VersionNumber: string;
Reg: TRegistry;
begin
VerInfo.dwOSVersionInfoSize := SizeOf(VerInfo);
GetVersionEx(VerInfo);
// Detect platform
Reg := TRegistry.Create;
Reg.RootKey := HKEY_LOCAL_MACHINE;
case VerInfo.dwPlatformId of
VER_PLATFORM_WIN32s:
begin
// Registry (Huh? What registry?)
PlatformId := 'Windows 3.1';
end;
VER_PLATFORM_WIN32_WINDOWS:
begin
// Registry
Reg.OpenKey('/SOFTWARE/Microsoft/Windows/CurrentVersion', False);
PlatformId := Reg.ReadString('ProductName');
VersionNumber := Reg.ReadString('VersionNumber');
end;
VER_PLATFORM_WIN32_NT:
begin
// Registry
Reg.OpenKey('/SOFTWARE/Microsoft/Windows NT/CurrentVersion', False);
PlatformId := Reg.ReadString('ProductName');
VersionNumber := Reg.ReadString('CurrentVersion');
end;
end;
Reg.Free;
Result := PlatformId + ' (version ' + VersionNumber + ')';
end;
 
给你个现成的吧
procedure TFormSplash.GetOSInfo;
var
Platform: string;
BuildNumber: Integer;
begin
case Win32Platform of
VER_PLATFORM_WIN32_WINDOWS:
begin
Platform := 'Windows 95/98';
BuildNumber := Win32BuildNumber and $0000FFFF;
end;
VER_PLATFORM_WIN32_NT:
begin
Platform := 'Windows NT';
BuildNumber := Win32BuildNumber;
end;
else
begin
Platform := 'Windows';
BuildNumber := 0;
end;
end;
if (Win32Platform = VER_PLATFORM_WIN32_WINDOWS) or
(Win32Platform = VER_PLATFORM_WIN32_NT) then
begin
if Win32CSDVersion = '' then
LabelOS.Caption :='操作系统:'+ Format('%s %d.%d (Build %d)', [Platform, Win32MajorVersion,
Win32MinorVersion, BuildNumber])
else
LabelOS.Caption :='操作系统:'+ Format('%s %d.%d (Build %d)', [Platform, Win32MajorVersion,
Win32MinorVersion, BuildNumber]);
end
else
LabelOS.Caption :='操作系统:'+ Format('%s %d.%d',[Platform,Win32MajorVersion,Win32MinorVersion])
end;
 
谢谢,谢谢个位高手!!!各有各的方法


分不多,撮合吧!!Appreciate your help
 
标注,要用!
 
后退
顶部