public static void StopFTPConnection() { if (ftpClient.IsConnected) { ftpClient.Abort(); ftpClient.Close(); } }
public void TestAbort(string host, int port, FtpSecurityProtocol protocol, string user, string pwd, string server) { using (FtpClient c = new FtpClient(host, port, protocol)) { c.AlwaysAcceptServerCertificate = true; c.Open(user, pwd); Assert.IsTrue(c.IsConnected); c.Abort(); } }