Как узнать номер BIOS для разных версий Windows?

Материал из DRKB

Как узнать номер BIOS для разных версий Windows?[править | править код]

Windows 9X


with Memo1.Lines do
begin
  Add('MainBoardBiosName:' + ^I + string(Pchar(Ptr($FE061))));
  Add('MainBoardBiosCopyRight:' + ^I + string(Pchar(Ptr($FE091))));
  Add('MainBoardBiosDate:' + ^I + string(Pchar(Ptr($FFFF5))));
  Add('MainBoardBiosSerialNo:' + ^I + string(Pchar(Ptr($FEC71))));
end;


Windows NT


procedure TBIOSInfo.GetRegInfoWinNT;
var
  RegistryV       : TRegistry;
  RegPath         : string;
  sl              : TStrings;
begin
  Params.Clear;
  RegPath := '\HARDWARE\DESCRIPTION\System';
  RegistryV := TRegistry.Create;
  RegistryV.RootKey := HKEY_LOCAL_MACHINE;
  sl := nil;
  try
    RegistryV.Openkey(RegPath, False);
    ShowMessage('BIOS Date: ' + RegistryV.ReadString('SystemBiosDate'));
    sl := ReadMultirowKey(RegistryV, 'SystemBiosVersion');
    ShowMessage('BIOS Version: ' + sl.Text);
  except
  end;
  RegistryV.Free;
  if Assigned(sl) then sl.Free;
end;

function ReadMultirowKey(reg: TRegistry; Key: string): TStrings;
const
  bufsize = 100;
var
  i: integer;
  s1: string;
  sl: TStringList;
  bin: array[1..bufsize] of char;
begin
  try
    result := nil;
    sl := nil;
    sl := TStringList.Create;
    if not Assigned(reg) then
      raise Exception.Create('TRegistry object not assigned.');
    FillChar(bin,bufsize,#0);
    reg.ReadBinaryData(Key,bin,bufsize);
    i := 1;
    s1 := '';
    while i < bufsize do
    begin
      if ord(bin[i]) >= 32 then
        s1 := s1 + bin[i]
      else
      begin
        if Length(s1) > 0 then
        begin
          sl.Add(s1);
          s1 := '';
        end;
      end;
      inc(i);
    end;
    result := sl;
  except
    sl.Free;
    raise;
  end;
end;


нашел на http://www.sources.ru/delphi/system/get_bios_information_w9x.shtml и http://www.sources.ru/delphi/system/get_bios_information_nt_2000_xp.shtml


Source: Взято с Vingrad.ru http://forum.vingrad.ru
ID: 01355



{ **** UBPFD *********** by delphibase.endimus.com ****
>> Получение серийного номера BIOS

Зависимости:

Copyright:
Дата:        03 мая 2002 г.
***************************************************** }

function GetBiosNumber: string;
begin
  Result := string(PChar(Ptr($FEC71)));
end;


Source: http://delphibase.endimus.com
ID: 01356