Jump to content

Recommended Posts

Posted
Hi all, I'm trying to show all files uploaded to the server in a directory XXXX ,
 
example:  Folder123 / *. *  ->
 
Folder123/ file1.jpg

Folder123/ file2.jpg

Folder123/ file3.jpg

 

 

UniServerModule.StartPath+'Folder123\'; ??????

 

 

Did anyone will have made?.
 
In advance, Thanks
 
mmurgas

 

Posted

function FindFiles(searchstr: string; list: TStrings): boolean;
var
  hn: THandle;
  fd: WIN32_FIND_DATA;
begin
  Result := False;
  hn := FindFirstFile(PChar(searchstr),fd);
  if hn <> INVALID_HANDLE_VALUE then begin
    Result := True;
    list.Add(StrPas(fd.cFileName));
    while FindNextFile(hn,fd) = True do
      list.Add(StrPas(fd.cFileName));
  end;
  Windows.FindClose(hn);
end;

 

 

How to use:

 

ComboBox.Items.Clear;

FindFiles(folder+'*.jpg',ComboBox.Items);

 

 

 

You can use any windows wildcards like:

 

'pr_uc_??????_.adt'

 

 

 

Bruno

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...