Setting connection timeout |
You can use the Timeout property to define the maximum number of milliseconds to wait when establishing a connection to an FTP server. Failure to establish a connection within the maximum time allowed will result in an FtpException being thrown.
Example
[C#]
// set connection timeout to 5 seconds
myFtp.Timeout 5000;
[Visual Basic]
' set connection timeout to 5 seconds
myFtp.Timeout = 5000