Uses Registry
Menyimpan Settingan Database
procedure TForm1.BBSimpanClick(Sender: TObject);
begin
try
// Membuat key baru
Reg.OpenKey(‘\Softwareku’, true);
// Menulis data string (Caption form) ke registry
Reg.WriteString(‘Host’, EHost.Text);
Reg.WriteString(‘Port’, EPortname.Text);
Reg.WriteString(‘User’, Euser.Text);
Reg.WriteString(‘Pass’, Epass.Text);
Reg.WriteString(‘Database’, EDBname.Text);
finally
Reg.CloseKey;
end;

end;

//ONCREATE FORM
procedure TForm1.FormCreate(Sender: TObject);
begin
Reg := Tregistry.Create;
Reg.RootKey := HKEY_CURRENT_USER;
end;

Memanggil Settingan database
try
try
Reg.OpenKey(‘\Softwareku’, false);
Edit1.Text := Reg.ReadString(‘Host’);
ComboBox1.Text := Reg.ReadString(‘Port’);
Edit2.Text := Reg.ReadString(‘User’);
Edit3.Text :=Reg.ReadString(‘Pass’);
Edit4.Text := Reg.ReadString(‘Database’);
except on ERegistryException do
ShowMessage(‘Gagal membaca settingan…’);
end;
finally
Reg.CloseKey;
End;
Diposkan oleh Borland7

0 komentar:

Visit the Site
MARVEL and SPIDER-MAN: TM & 2007 Marvel Characters, Inc. Motion Picture © 2007 Columbia Pictures Industries, Inc. All Rights Reserved. 2007 Sony Pictures Digital Inc. All rights reserved. blogger templates