引用IniFiles单元。
var
xx: Tinifile;
path: string;
begin
path := ExtractFilePath(Paramstr(0))+'program.ini';
ShowMessage(path);
xx := TIniFile.Create(path);
xx.WriteString('mysql','host','192.168.0.3');
xx.WriteString('mysql','username','root');
xx.WriteString('mysql','password','root');
xx.WriteInteger('mysql','age',29);
xx.WriteString('oracle','host','192.168.0.3');
xx.WriteString('oracle','username','root');
xx.WriteString('oracle','password','root');
xx.WriteBool('oracle','sex',True);
// xx.UpdateFile;
end;