Ver Mensaje Individual
  #2  
Antiguo 12-02-2008
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.107
Reputación: 34
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

Propongo algo así, aunque, no sé si te servirá o qué.

Código Delphi [-]
function FileToStr(
 path: string): string;
var
  aFile: TextFile;
begin
  AssignFile(aFile, path);
  Reset(aFile);
  while not Eof(aFile) do
    ReadLn(aFile, result);
  CloseFile(aFile);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  s: string;
  sr: TSearchRec;
begin
  SetCurrentDir(ExtractFileDir(ParamStr(0)));
  if FindFirst('.\*.csv', faAnyFile, sr) = 0 then
  begin
    try
      repeat
        s :=  s + FileToStr('.\' + sr.Name)
      until (FindNext(sr) <> 0);
    finally
      FindClose(sr);
    end;
  end;

  ShowMessage(s);
end;
__________________
David Esperalta
www.decsoftutils.com

Última edición por dec fecha: 12-02-2008 a las 18:59:21.
Responder Con Cita