Einzelnen Beitrag anzeigen

gene

Registriert seit: 11. Feb 2008
55 Beiträge
 
Delphi 7 Personal
 
#1

FTP Client (indy) für Anfänger - Hilfe!

  Alt 17. Feb 2008, 10:58
Hallo!

Ich bekomme ne Fehlermeldung: Zugriffsverletzung der Addresse 000dEC im Moduel ftp.exe

Code:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdFTP, ExtCtrls, Buttons;

type
  TForm1 = class(TForm)
    IdFTP1: TIdFTP;
    SpeedButton1: TSpeedButton;
    Panel1: TPanel;
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  ftp : TidFTP;
implementation

{$R *.dfm}

procedure TForm1.SpeedButton1Click(Sender: TObject);

begin
  try
  ftp.Username := 'gene2';
  ftp.Password := '****';
  ftp.Port := 21;
  ftp.Host := 'gene2.ge.funpic.de';
  except
  ShowMessage('Could not set Data');
    end;

   try
    ftp.Connect;
   except
    ShowMessage('Could not connect');
    end;

   try
    ftp.Put('upload.txt', 'upload.txt');
    except
     ShowMessage('Could not upload');
     end;

  ftp.Disconnect;
end;

end.
Exeption: "Could not set Data" tritt ein.

Was mach ich falsch?
  Mit Zitat antworten Zitat