interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdFTP, MPlayer, BassdllPlayer, ComCtrls;
type
TForm1 =
class(TForm)
GroupBox1: TGroupBox;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
GroupBox2: TGroupBox;
Button3: TButton;
Panel1: TPanel;
IdFTP1: TIdFTP;
BassdllPlayer1: TBassdllPlayer;
Button4: TButton;
SaveDialog1: TSaveDialog;
OpenDialog1: TOpenDialog;
Button5: TButton;
ProgressBar1: TProgressBar;
Edit4: TEdit;
ListBox2: TListBox;
SaveDialog2: TSaveDialog;
Button6: TButton;
Button7: TButton;
procedure Button1Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject;
var Key: Char);
procedure Edit2KeyPress(Sender: TObject;
var Key: Char);
procedure Edit3KeyPress(Sender: TObject;
var Key: Char);
procedure Button4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure ListBox2DblClick(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function IsFile(
const Filename :
String) : Boolean;
var
IsFile: Boolean;
begin
if FileExists(Filename)
then
begin
Result := true;
end
else
begin
Result := false;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
IDFTP1.Host := edit1.text;
IDFTP1.Username := edit2.text;
IDFTP1.Password := edit3.text;
IDFTP1.Passive := true;
IDFTP1.Connect();
idftp1.list (listbox2.items,'
',false);
end;
procedure TForm1.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
BassDLLPlayer1.LoadFromFile('
C:\Dokumente und Einstellungen\Bass Sultan\Eigene Dateien\sound1.wav');
BassDLLPlayer1.Volume := 90;
BassDLLPlayer1.play;
end;
procedure TForm1.Edit2KeyPress(Sender: TObject;
var Key: Char);
begin
BassDLLPlayer1.LoadFromFile('
C:\Dokumente und Einstellungen\Bass Sultan\Eigene Dateien\sound1a.wav');
BassDLLPlayer1.Volume := 90;
BassDLLPlayer1.play;
end;
procedure TForm1.Edit3KeyPress(Sender: TObject;
var Key: Char);
begin
BassDLLPlayer1.LoadFromFile('
C:\Dokumente und Einstellungen\Bass Sultan\Eigene Dateien\sound1.wav');
BassDLLPlayer1.Volume := 90;
BassDLLPlayer1.play;
end;
procedure TForm1.Button4Click(Sender: TObject);
var s:
string;
begin
s:='
New Folder';
if inputQuery('
New Folder','
New Folder Name',s)
then
begin
idftp1.MakeDir(s);
end;
IdFTP1.List(ListBox2.Items);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
idftp1.Disconnect;
listbox2.Clear;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if openDialog1.Execute
then
begin
idftp1.Put(OpenDialog1.FileName,extractFilename(opendialog1.FileName));
IdFTP1.List(ListBox2.Items);
end;
end;
procedure TForm1.ListBox2DblClick(Sender: TObject);
begin
if Listbox2.ItemIndex <> - 1
then
begin
if IsFile(ListBox2.Items[ListBox2.ItemIndex])
then // Hier ist es eine Datei
begin
// Hier kommt dein Code zum eine Datei runterzuladen
end
else
begin
IDFTP1.ChangeDir(Listbox2.Items[Listbox2.ItemIndex]);
// Verzeichnis wechseln
idftp1.list(listbox2.items,'
',false);
end;
end;
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
IdFTP1.ChangeDir(Edit4.Text);
idftp1.list(listbox2.items,'
',false);
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
IdFTP1.ChangeDir('
..');
idftp1.list(listbox2.items,'
',false);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
edit1.text := '
ftp.*********.**.funpic.de';
edit2.text := '
*********';
edit3.text := '
*********';
end;
end.