Operating System (OS), Hardware info.


This demo show you how to get Hardware info.
Operating System (OS) info.

Uses JclSysInfo

var
CPUInfo: TCpuInfo;

procedure TfrmMain.log(const msg: string);
begin
  Memo1.Lines.Add(msg);
end;

Display info. on TMemo.

procedure TfrmMain.FormCreate(Sender: TObject);
var
  OSArchitecture: string;
begin
  GetCpuInfo(CPUInfo);
  OSArchitecture := '32-bit Edition';

  if IsWindows64 then
    OSArchitecture := StringReplace(OSArchitecture, '32', '64',
      [rfReplaceAll, rfIgnoreCase]);

  with CPUInfo do
  begin
    log(format('Operating System(OS): %s (Version %s, %s)',
      [GetWindowsVersionString, GetWindowsVersionNumber, OSArchitecture]));
    log(format('Memory Available to Windows: %10.0n KB',
      [GetTotalPhysicalMemory / 1024]));
    log('');
    log(format('Computer name %s', [GetLocalComputerName]));
    log('');
    log(format('Vendor ID: %s', [VendorIDString]));
    log(format('Manufacturer: %s', [Manufacturer]));
    log(format('Cpu Name: %s', [CpuName]));

    log('');

    log(format('BIOS Name: %s', [GetBIOSName]));
    log(format('BIOS Copyright %s', [GetBIOSCopyright]));
    log(format('BIOS Extended Info: %s', [GetBIOSExtendedInfo]));
    log(format('BIOS Date: %s', [formatdatetime('dd/mm/yyyy', GetBIOSDate)]));
  end;
end;


Comments