sammyrano
27-09-2006, 00:23:03
Hola a todos.
Tengo una duda para lograr leer el registro de una máquina de manera remota. Hata el momento he checado la librería TRegistry, pero no he encontrado una manera de conseguir leer un equipo remoto. Principalmente lo que deseo realizar es obtener las claves de windows y uso la siguiente tarea:
Código Delphi [-] (http://www.clubdelphi.com/foros/#)
function View_Win_Key: string;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKeyReadOnly('\SOFTWARE\Microsoft\Windows NT\CurrentVersion') then
begin
if Reg.GetDataType('DigitalProductId') = rdBinary then
begin
PN := (Reg.ReadString('ProductName'));
PID := (Reg.ReadString('ProductID'));
binarySize := Reg.GetDataSize('DigitalProductId');
SetLength(HexBuf, binarySize);
if binarySize > 0 then
begin
Reg.ReadBinaryData('DigitalProductId', HexBuf[0], binarySize);
end;
end;
end;
finally
FreeAndNil(Reg);
end;
Result := '';
Result := DecodeProductKey(HexBuf);
end;
Tengo una duda para lograr leer el registro de una máquina de manera remota. Hata el momento he checado la librería TRegistry, pero no he encontrado una manera de conseguir leer un equipo remoto. Principalmente lo que deseo realizar es obtener las claves de windows y uso la siguiente tarea:
Código Delphi [-] (http://www.clubdelphi.com/foros/#)
function View_Win_Key: string;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKeyReadOnly('\SOFTWARE\Microsoft\Windows NT\CurrentVersion') then
begin
if Reg.GetDataType('DigitalProductId') = rdBinary then
begin
PN := (Reg.ReadString('ProductName'));
PID := (Reg.ReadString('ProductID'));
binarySize := Reg.GetDataSize('DigitalProductId');
SetLength(HexBuf, binarySize);
if binarySize > 0 then
begin
Reg.ReadBinaryData('DigitalProductId', HexBuf[0], binarySize);
end;
end;
end;
finally
FreeAndNil(Reg);
end;
Result := '';
Result := DecodeProductKey(HexBuf);
end;