Article View: borland.public.cppbuilder.nativeapi
Article #9547Re: Read the BIOS
From: Edward
Date: Thu, 01 Jul 2004 03:35
Date: Thu, 01 Jul 2004 03:35
88 lines
3047 bytes
3047 bytes
I got this code but its in delphi any one to convert?
BIOS
----------------------------------------------------------------------------
----
??? ???????? ?????????? ? BIOS ? Windows NT, 2000, XP
? NT/2000/XP ?? ????????? ????????? ???????? ????? ?? BIOS, ??????, ??????
?? ?????? ??? ??????? ?????? ???????? ?? ???????.
procedure TBIOSInfo.GetRegInfoWinNT;
var
Registryv: TRegistry;
RegPath: string;
sl: TStrings;
begin
Params.Clear;
RegPath := 'HARDWAREDESCRIPTIONSystem';
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;
?? ?????? ????????:
// ????????? ????? ???????? ????????????? ???????? ?? ???????
// ? ??????????? ?? ? TStringlist
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;"Fabi�n Fierro" <fabianfierro@hotmail.com> escreveu na mensagem
news:40c86e9e@newsgroups.borland.com...
> Do someone knows how to read the BIOS serial number?
>
>
"Fabi�n Fierro" <fabianfierro@hotmail.com> escreveu na mensagem
news:40c86e9e@newsgroups.borland.com...
> Do someone knows how to read the BIOS serial number?
>
>
Technical Details
Message-ID:
<40e386a0@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40c86e9e@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e3066f787953dff9 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII Reply-To: "Edward" <registrados@via-rs.net> From: "Edward" <registrados@via-rs.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <40c86e9e@newsgroups.borland.com> Subject: Re: Read the BIOS Date: Thu, 1 Jul 2004 00:35:55 -0300 Lines: 90 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 200.213.40.136 Message-ID: <40e386a0@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088652960 200.213.40.136 (30 Jun 2004 20:36:00 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail