Ver Mensaje Individual
  #2  
Antiguo 27-09-2006
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Reputación: 26
seoane Va por buen camino
Prueba con algo como esto:

Código Delphi [-]
function View_Win_Key(UNCName: string): string;
var
  Size: Integer;
  HexSrc: array of Byte;
begin
  Result:= '';
  with TRegistry.Create do
  try
    RootKey:= HKEY_LOCAL_MACHINE;
    // Esta es la instruccion que supongo que buscabas
    if RegistryConnect(UNCName) then
    begin
      if OpenKeyReadOnly('\SOFTWARE\Microsoft\Windows NT\CurrentVersion') then
      begin
        Size:= GetDataSize('DigitalProductId');
        SetLength(HexSrc,Size);
        ReadBinaryData('DigitalProductId',HexSrc[0],Size);
        Result:= DecodeProductKey(HexSrc);
        CloseKey;
      end;
    end;
  finally
    Free;
  end;
end;


// Por ejemplo
ShowMessage(View_Win_Key('\\192.168.0.10'));
Responder Con Cita