1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
if FindFirst(ExtractFilePath(Application.ExeName) + 'Tickets\*.txt', faAnyFile, SR)=0 then
begin
repeat
AssignFile(Fichier, ExtractFilePath(Application.ExeName) + 'Tickets\' + SR.FindData.cFileName);
{$I-} Reset(Fichier); {$I+}
if IOResult = 0 then
begin
while not EOF(Fichier) do
begin
ReadLn(Fichier,Ligne);
IdTCPClient1.IOHandler.WriteLn(Ligne);
Log(Format('Envoi du ticket %s : %s',[SR.FindData.cFileName, Ligne]));
end;
CloseFile(Fichier);
DeleteFile(ExtractFilePath(Application.ExeName) + 'Tickets\' + SR.FindData.cFileName);
end;
until FindNext(SR) <> 0;
FindClose(SR);
end; |
Partager