Показать сообщение отдельно
  #10  
Старый 13.12.2006, 01:43
Аватар для Decoding
Decoding Decoding вне форума
Местный
 
Регистрация: 03.06.2006
Адрес: Почту найдете на моем сайте
Сообщения: 576
Версия Delphi: D10.2
Репутация: 214
По умолчанию

Вот самый простой способ
Код:
 
function FileParser( Path, str: string ): boolean;
var
  s: string;
  f: TextFile;
begin
   Result := false;
   AssignFile( f, Path );
   Reset( f );
   while not Eof( f ) do
   begin
      Readln( f, s );
      if Pos( str, s ) > 0 then
      begin
         Result := true;
         Break;
      end;
   end;
   CloseFile( f );
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
   FileParser( 'c:\1.txt', 'искомая_строка' );
end;
Ответить с цитированием