Article View: borland.public.cppbuilder.nativeapi
Article #9567BETTER SOLUTION , WE NEED?
From: Edward
Date: Sun, 04 Jul 2004 22:01
Date: Sun, 04 Jul 2004 22:01
175 lines
5291 bytes
5291 bytes
HEY GUYS THIS CODE DOENST WORK IN SOME KIND OF BIOS BECAUSE THEY DONT RECORD
IN REG_MULTI_SZ TYPE OF REGITRY.
SO WE NEED A BETTER SOLUTION.
EDWARD
"Edward" <Registrados2004@aol.com> escreveu na mensagem
news:40e390bf@newsgroups.borland.com...
> 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:
<40e884b0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!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> <40e390bf@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> <40e390bf@newsgroups.borland.com> Subject: BETTER SOLUTION , WE NEED? Date: Sun, 4 Jul 2004 19:01:13 -0300 Lines: 177 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.49.155 Message-ID: <40e884b0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088980144 200.213.49.155 (4 Jul 2004 15:29:04 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail