When the ftp client fails to connect the server,the program break at "throw;"
Can I remove the "throw" to solve this problem?
public virtual void Connect()
{
lock (clientLock)
{
bool loggedIn = false;
try
{
if (LocalDirectory==null)
LocalDirectory = Directory.GetCurrentDirectory();
if (ServerAddress == null)
throw new FTPException("ServerAddress not set");
OnConnecting();
ActiveClient.Connect();
log.Debug("Connected to " + ServerAddress + " (instance=" + instanceNumber + ")");
OnConnected(true);
loggedIn = PerformAutoLogin();
}
catch
{
OnConnected(IsConnected);
if (!IsConnected)
OnClosed();
throw;
}
if (loggedIn)
PostLogin();
}
}