Re: OnAfterClientLogin

Giganews Newsgroups
Subject: Re: OnAfterClientLogin
Posted by:  Remy Lebeau (TeamB) (gambit…
Date: Wed, 17 Sep 2003

"Dan" <da…> wrote in message
> I am trying to have my app login to the ftp server, then change
> to the appropriate directory than transfer files all without any
> user intervention. I have found the only event that occurs when
> after the user logs in, is the onafterClientLogin event.

You need to unlearn what you have learned about VCL components when dealing
with Indy.  You do not need to use any events at all to do what you are
asking for.  Indy is not an event-driven library, its events are primarily
meant for status purposes only.  Indy is a blocking library, all operations
block the calling thread until the operations have been completed.  This
allows Indy to be programmed in a very linear fashion.

> When I try to changedir() within the event, I get the error
> "unable to build data connection, no route to host".

Do not use any event for that.  Simply call ChangeDir() after Connect()

        IdFTP1.ChangeDir('some folder');
        IdFTP1.Get('somefile.ext', 'c:\somefile.ext', True, False);


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system
Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03


In response to

OnAfterClientLogin posted by Dan on Tue, 16 Sep 2003