Пример #1
0
 public static void StopFTPConnection()
 {
     if (ftpClient.IsConnected)
     {
         ftpClient.Abort();
         ftpClient.Close();
     }
 }
Пример #2
0
 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();
     }
 }