public void Execute() { IFtpClient client; try { client = FtpServer.ConnectToServer(); client.Connect(); } catch (Exception) { FailedToConnectToServer = true; return; } FileAction(client); client.Disconnect(); client.Dispose(); }