Einzelnen Beitrag anzeigen

Admirandis
(Gast)

n/a Beiträge
 
#5

Re: idFTP erhängt sich nach einer halben Stunde

  Alt 23. Dez 2008, 07:32
@Andidreas: Mit dem Noop hab ichs grad probiert, aber da erhängt er sich noch schneller! Nichtmal 1,5 min! Vorher hab ich ja immer connected und wieder disconnected! Wobei das mit dem Noop schöner wäre...

@Muhkuh: Hier ist der intressante Part:

Delphi-Quellcode:
procedure TForm1.threadRun(Sender: TIdThreadComponent);
var
 zefux: String;
 cnt: integer;
begin

if JvHLEditor1.Lines.Count > 15 then
    JvHLEditor1.Clear; // Das ist nur ein Log von mir; hat nix mit der Funktion zu tun!

ak.Host := 'werdasliestistdoof.com';
ak.Username := 'angela';
ak.Password := 'merkel';

  while ak.Connected = false do
    begin
      ak.Connect;
      ak.ChangeDir('officeclipper');
      JvHLEditor1.Lines.Add('connected @ '+timetostr(now)); //Daten ins Log
    end;

ak.List(listbox1.Items, '', false);


if ((listbox1.Items.IndexOf(you) <> -1) and (hinti = false)) then
    begin
        hinti := true;
    end;

if listbox1.Items.IndexOf(you) <> -1 then
    begin
        download := true;
    end;

if upload = true then
    begin
        noti.Hide;
        progi.Show;
        form1.Caption := 'Uploading';
        JvTrayIcon1.BalloonHint('Upload', 'Sie laden jetzt eine Datei hoch xD', btInfo, 5000, true);
        richi.Lines.SaveToFile('C:\'+me);

        if listbox1.Items.IndexOf(me) <> -1 then
            ak.Delete(me);

        ak.Put('C:\'+me, me+'up', true);
        ak.Rename(me+'up', me);
        upload := false;
        form1.Caption := 'Upload succesful!';
        richi.Clear;
        progi.Hide;
        noti.Show;
    end;

if download = true then
    begin
        noti.Hide;
        progi.Show;
        form1.Caption := 'Downloading';
        JvTrayIcon1.BalloonHint('Download', 'Es wird eine Datei heruntergeladen', btInfo, 5000, true);
        ak.Get(you, 'C:\'+you, true);
        ak.Delete(you);
        richi.Lines.LoadFromFile('C:\'+you);
        download := false;
        richi.SelectAll;
        richi.CopyToClipboard;
        form1.Caption := 'Download succesful!';
        hinti := false;
        zefux := richi.text;
        if length(zefux) < 5 then
          zefux := 'Datei wurde heruntergeladen und ist im Clipboard!';
        progi.Hide;
        noti.Show;
        JvTrayIcon1.BalloonHint('Clipboard', zefux, btInfo, 5000, true);
    end;

if delall = true then
    begin
        for cnt := 0 to listbox1.Count-1 do
            ak.Delete(listbox1.items[cnt]);
        showmessage('Server ist wieder clean ;-)');
    end;


{    while ak.Connected = true do
    ak.disconnect;  }


ak.Noop; // Vorher hab ich den Client wieder disconnected (s.o.). Der Noop klappt blöderweise auch net!

JvHLEditor1.Lines.Add('refreshed @ '+timetostr(now)) // Und wieder was für das Log ;-)

end;
Viele Grüße

Admirandis
  Mit Zitat antworten Zitat