Busca de arquivos em pasta do windows

Delphi

23/01/2007

Boa tarde pessaol

To usando uma procedure pra buscar arquivos numa certa pasta de acordo com o nome q o usuario digitar num edit...

segue o codigo :

procedure TForm1.SearchFilePath(pasta: string);
var
    x: integer;
    SearchRec: TSearchRec;
    intControl: integer;
    Name: string;
begin
Memo1.Lines.Clear;
intControl:=FindFirst(pasta + ´\*.*´, faArchive, SearchRec);
if intControl = 0 then
    begin
    while (intControl = 0) do
        begin
        Name:=ExtractFileName(SearchRec.Name);

[b:df3b85b4ed]if Name = edit2.Text then[/b:df3b85b4ed] /// usar tipow um ´Like´
 memo1.Lines.Add(pasta + ´\´ + SearchRec.Name);
        intControl:=FindNext(SearchRec);
        end;
    FindClose(SearchRec);
    end;



como eu faria pra buscar por nome do arquivo naum exato ´por exemplo: axar os aquivos q estao na pasta meus documentos cujo nome contenham ´PRO´ ´


Output

Output

Curtidas 0

Respostas

Output

Output

23/01/2007

(Resolvido)


GOSTEI 0
Emerson Nascimento

Emerson Nascimento

23/01/2007

if pos(edit2.Text, Name) > 0 then


GOSTEI 0
POSTAR