Ver Mensaje Individual
  #6  
Antiguo 08-09-2011
ptorres ptorres is offline
Registrado
 
Registrado: mar 2007
Posts: 6
Reputación: 0
ptorres Va por buen camino
Clase para sacar la informacion de la Placa Base

Amigos esta es una clase para sacar los datos de la tarjeta madre y el CPU no se si les sirva la acabo de hacer.

espero que les sirva

Código Delphi [-]
unit clSistema;

interface

uses Registry,Windows,SysUtils;
type
  TBIOS = class
    constructor create;
   Public
    Fabricante,ProductoBase,VersionTarjeta,
    Fecha,Vendedor,VersionBios,FamiliaSistema,FabricanteSistema,
    NombreProducto,SKU,VersionSistema:String;
  end;

  TCPU = class
   constructor create(NoCPU : Integer);
   Public
    Identificador,NombreProcesador,Vendedor,ActualizacionMicroCode:String;
  end;
  TSistema = class
   constructor create;
   destructor Destroy;
  Public
   Bios : TBios;
   CPU1  : TCPU;
   CPU2  : TCPU;
   CPU3  : TCPU;
   CPU4  : TCPU;
  end;

implementation
const vBios: string = '\HARDWARE\DESCRIPTION\System\BIOS';
const vCPU: string = '\HARDWARE\DESCRIPTION\System\CentralProcessor';

////////////////////
////////// clase sistema
///////////////////

constructor TSistema.create;
Begin
 Bios:=TBios.create;
 CPU1:=TCPU.create(0);
 CPU2:=TCPU.create(1);
 CPU3:=TCPU.create(2);
 CPU4:=TCPU.create(3);
End;

destructor TSistema.Destroy;
Begin
 Bios.Free;
 CPU1.Free;
 CPU2.Free;
 CPU3.Free;
 CPU4.Free;
End;
////////////////////
////////// clase bios
///////////////////

constructor TBIOS.create;
var Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.Rootkey:= HKEY_LOCAL_MACHINE;
    Reg.OpenKey(vBios, False);
    Fabricante:=Reg.ReadString('BaseBoardManufacturer');
    ProductoBase:=Reg.ReadString('BaseBoardProduct');
    VersionTarjeta:=Reg.ReadString('BaseBoardVersion');
    Fecha:=Reg.ReadString('BIOSReleaseDate');
    Vendedor:=Reg.ReadString('BIOSVendor');
    VersionBios:=Reg.ReadString('BIOSVersion');
    FamiliaSistema:=Reg.ReadString('SystemFamily');
    FabricanteSistema:=Reg.ReadString('SystemManufacturer');
    NombreProducto:=Reg.ReadString('SystemProductName');
    SKU:=Reg.ReadString('SystemSKU');
    VersionSistema:=Reg.ReadString('SystemVersion');
  finally
    Reg.Free;
  end;
End;
////////////////////
////////// clase CPU
///////////////////

constructor TCPU.create;
var Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.Rootkey:= HKEY_LOCAL_MACHINE;
    if Reg.OpenKey(vCPU+'\'+IntToStr(NoCPU), False) then
     Begin
      Identificador:=Reg.ReadString('Identifier');
      NombreProcesador:=Reg.ReadString('ProcessorNameString');
      Vendedor:=Reg.ReadString('VendorIdentifier');
      ActualizacionMicroCode:=Reg.ReadString('MicrocodeUpdateStatus');
     End
    else
     Begin
      Identificador:='No Presente';
      NombreProcesador:='No Presente';
      Vendedor:='No Presente';
      ActualizacionMicroCode:='No Presente';
     End;
  finally
    Reg.Free;
  end;
End;

end.
Responder Con Cita