Hola cipce22, bienvenido a
Club Delphi .
Como a todos los que ingresan te recomendamos leer nuestra
guía de estilo.
Si tenes definidos los alias en aliases.conf, para obtener la lista de alias/rutas desde Delphi, podrías hacer:
Código Delphi
[-]
...
uses Registry;
procedure GetFirebirdAliases(Strings: TStrings);
var
path: string;
i : Integer;
begin
with TRegistry.Create do
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKeyReadOnly('\SOFTWARE\Firebird Project\Firebird Server\Instances') then
path := ReadString('DefaultInstance');
Strings.LoadFromFile(path + 'aliases.conf');
for i:= Strings.Count-1 downto 0 do
if Pos('#', Trim(Strings[i])) = 1 then
Strings.Delete(i);
finally
Free;
end;
end;
Ejemplo de uso:
Código Delphi
[-]
procedure TForm1.Button1Click(Sender: TObject);
begin
with ListBox1 do
begin
Items.Clear;
GetFirebirdAliases(Items);
end;
end;
Saludos