Topic: How To Read Registry For Show Information

how to read registry in my pc and display information  username ,ram,ip4 and etc

procedure Form1_OnShow (Sender: string; Action: string);
begin
Form1.Memo1.Text := ??? ;
Form1.Edit1.Text := ??? ;
Form1.Edit2.Text := ??? ;
Form1.Edit3.Text := ??? ;
Form1.Edit4.Text := ??? ;
Form1.Edit5.Text := ??? ;
Form1.Edit6.Text := ??? ;

end;

How To edit ?
https://s32.postimg.org/zbbtu8601/Image_007.png

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: How To Read Registry For Show Information

Hello,


An example:

// how to read
procedure Form1_OnShow (Sender: string; Action: string);
var
   reg: TRegistry;
begin
     reg := TRegistry.Create;
     reg.Access := KEY_READ;  // KEY_ALL_ACCESS    req. administrator's rights
     reg.RootKey := HKEY_LOCAL_MACHINE;

     if reg.OpenKey('HARDWARE\DESCRIPTION\System\CentralProcessor\0', false) then
     begin
         if reg.ValueExists('ProcessorNameString') then Form1.Edit1.Text := reg.ReadString('ProcessorNameString');
     end
         else ShowMessage('Can''t open the key.');

     reg.CloseKey;                     
     reg.Free;
end;


// how to write
procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
   reg: TRegistry;
begin
     reg := TRegistry.Create;
     reg.Access := KEY_WRITE;
     reg.RootKey := HKEY_LOCAL_MACHINE;
     if reg.OpenKey('HARDWARE\DESCRIPTION\System\CentralProcessor\0', false) then
     begin
         reg.WriteString('ProcessorNameString', Form1.Edit1.Text);
     end
         else ShowMessage('Can''t open the key to write data.');

     reg.CloseKey;
     reg.Free;
end;


Here you can find more info, where in the Windows registry placed info about PC
http://www.liutilities.com/products/reg … aks/10019/



To write data to the HKEY_LOCAL_MACHINE section you must run project with administrator rights.

Dmitry.