indy - Delphi connection test with TIdFTP -


on program i'm using code:

if idftp1.connect = true  begin   //makes stuff  end else  begin   showmessage('you got move jagger.');  end; 

if not connected see error

socket error #11001

host not found

to avoid this, thought use code see above having error when use idftp1.connect = true.

what do?

connect() not return boolean if fails. raises exception instead:

try   idftp1.connect;   try     //makes stuff       idftp1.disconnect;   end; except   showmessage('you got move jagger.'); end; 

Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -