Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7.6k views
in General by (220 points)
This part of my code..how do I verify whether it connects or not? Whether the remote server is available?
If it can't connect, I need to perform other functions of the program. I'm using the free version..
Thanks
ftp.ServerAddress = "x.x.x.x"
ftp.ServerPort = 21
ftp.UserName = "username"
ftp.Password = "password"
ftp.Connect()

1 Answer

0 votes
by (51.1k points)
Simply put a try-catch block around the call to Connect. Connect will throw an IOException or an FTPException if it has problems connecting.

- Hans (EnterpriseDT)

Categories

...