Article View: borland.public.cppbuilder.nativeapi
Article #9548Re: Read the BIOS
From: Edward
Date: Thu, 01 Jul 2004 04:19
Date: Thu, 01 Jul 2004 04:19
159 lines
4685 bytes
4685 bytes
I Cant WAIT
AnsiString VersaoBios;
char biosnro[100];
int i;
TRegistry *Reg;
i=0;
while(i < sizeof(biosnro))
{
biosnro[i] = ' ';
i++;
}
try
{
Reg = new TRegistry;
}
catch(...)
{
MessageDlg("AUTORUN ERROR! ", mtError, TMsgDlgButtons() << mbOK, 0);
}
Reg->RootKey = HKEY_LOCAL_MACHINE;
Reg->OpenKey("\\HARDWARE\\DESCRIPTION\\System", false);
if(Reg->KeyExists("\\HARDWARE\\DESCRIPTION\\System"))
{
Reg->ReadBinaryData("SystemBiosVersion",&biosnro,sizeof(biosnro));
i=0;
while(i < sizeof(biosnro))
{
if(biosnro[i] == '\0'){
VersaoBios = VersaoBios + AnsiString(" # ");
}
else{
VersaoBios = VersaoBios + AnsiString(biosnro[i]);
}
i++;
}
Memo1->Lines->Add( VersaoBios );
}
Reg->CloseKey();
delete Reg;
Just FOR Windows NT, 2000, XP
Any one to convert
??? ???????? ?????????? ? BIOS ? Windows 9x
procedure TForm1.Button1Click(Sender: TObject);
begin
with Memo1.Lines do
begin
Add('MainBoardBiosName: '+string(Pchar(Ptr($FE061))));
Add('MainBoardBiosCopyRight: '+string(Pchar(Ptr($FE091))));
Add('MainBoardBiosDate: '+string(Pchar(Ptr($FFFF5))));
Add('MainBoardBiosSerialNo: '+string(Pchar(Ptr($FEC71))));
end;
end;
"Edward" <registrados@via-rs.net> escreveu na mensagem
news:40e386a0@newsgroups.borland.com...
> 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:
<40e390bf@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> <40e386a0@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" <Registrados2004@aol.com> From: "Edward" <Registrados2004@aol.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40c86e9e@newsgroups.borland.com> <40e386a0@newsgroups.borland.com> Subject: Re: Read the BIOS Date: Thu, 1 Jul 2004 01:19:06 -0300 Lines: 161 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: <40e390bf@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088655551 200.213.40.136 (30 Jun 2004 21:19:11 -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