Delphi помогите процедуру сделать в обратную сторону
она сохраняет значения реестра в файл а как ее развернуть чтобы из файла в реестр?
const
BranchName = 'Software\Microsoft\Windows\Shell\Bags\1\Desktop';
KeyName = 'ItemPos1920x1080x96(1)';
var
Reg: TRegistry;
Sz: Integer;
Data: array of Char;
Text: string;
F: TextFile;
begin
Reg := TRegistry.Create (HKEY_CURRENT_USER);
try
if Reg.OpenKey(BranchName,False) then
begin
Sz := Reg.GetDataSize(KeyName);
SetLength(Data,Sz);
Reg.ReadBinaryData(KeyName,Data[0],Sz);
SetLength (Text, Sz*2);
BinToHex (@Data[0],PChar(Text),Sz);
AssignFile ( F, 'Desktop '+datetostr(date()));
Rewrite (F);
try
WriteLn (F,Text);
finally
CloseFile (F);
end;
end;
finally
Reg.Free;
end;
http://stackoverflow.com/questions/12811340/how-to-write-binary-data-into-registry
PS Read на Write поменять