unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl, ComCtrls;
type
TForm1 =
class(TForm)
ProgressBar1: TProgressBar;
Memo1: TMemo;
SaveDialog1: TSaveDialog;
FileListBox1: TFileListBox;
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FileListBox1Change(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
a:integer;
implementation
{$R *.dfm}
procedure TForm1.FileListBox1Change(Sender: TObject);
begin
FileListBox1.ApplyFilePath('
C:\');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
savedialog1.Execute;
memo1.Lines.savetofile(savedialog1.filename+ '
.mp3');
end;
public
procedure GetFiles(
const Path:
string);
{ Public-Deklarationen }
procedure TForm1.GetFiles(
const Path:
string);
var
SearchRec: TSearchRec;
p:
string;
begin
Label1.Caption:='
';
p := path + '
*.*';
if FindFirst(p, faAnyFile, SearchRec) = 0
then
begin
repeat
if (SearchRec.Attr
and faDirectory) = faDirectory
then
begin
if (SearchRec.
Name <> '
.')
and (SearchRec.
Name <> '
..')
then
GetFiles(Path + SearchRec.
Name + '
\');
end
else begin
Form1.Memo1.Lines.Add(Path + SearchRec.
Name);
a:=a+1;
Refresh;
Application.ProcessMessages;
ProgressBar1.StepIt;
end;
until
FindNext(SearchRec) <> 0;
FindClose(SearchRec);
end;
ProgressBar1.Position:=0;
Label1.Caption:=IntToStr(a) +'
Dateien gescannt';
end;
end;
end.