Export Registry Key in Delphi

var
 R: TRegistry;
 ErrorCode: Integer;
begin
 NTSetPrivilege('SeBackupPrivilege', true);
 R:= TRegistry.Create;
 try
 R.RootKey := HKEY_LOCAL_MACHINE;
 if R.OpenKeyReadOnly('\Software\My Key') then
 begin
 ErrorCode := RegSaveKey(R.CurrentKey, 'export.reg'), nil);
 R.CloseKey;
 if ErrorCode <> ERROR_SUCCESS then
 raise Exception.CreateFmt('Error Code: %u', [ErrorCode]);
 end
 else
 raise Exception.Create('Key does not exist');
 finally
 R.Free;
 end;
end;
Advertisements

Try to VS Try -ing

  • I’m trying to learn Japanese but it’s very difficult.

Try + to + infinitive means that something is difficult and you make an attempt to do it.

 

  • Have you tried using butter instead of oil?

Try + ‘ing’ means make an experiment. It’s not difficult – it might work, it might not.

OpenVZ vs KVM

When to Use OpenVZ Virtualization?
Use OpenVZ if you want the lowest price for a VPS. OpenVZ is a good entry level into VPS hosting. Via our Breeze Control Panel, you can easily install the OS of your choice.
OpenVZ uses a common shared kernel. Because of the shared kernel, overhead is lower and so is RAM consumption per VPS. A disadvantage to OpenVZ would be that a kernel failure could cause a failure across all VPS instances running on the same server. The shared kernel limits the operating systems you can run and keep in mind, the latest OSes with newer kernels may not work under OpenVZ.

When to Use KVM Virtualization?
Use KVM if you are as business or your project is for a business. KVM is capable of full encryption of stored data. KVM has independent kernels for each VPS. With an independent kernel you can a wider selection of operating systems, including the latest Linux releases, BSD and Microsoft Windows.
Since KVM is true virtualization, reliability and uptime on average should be greater under KVM.