Exemplo n.º 1
0
 /// <summary>
 ///  Отключение
 /// </summary>
 public void Disconnect()
 {
     if (ftpClient.IsConnected)
     {
         ftpClient.Disconnect();
     }
 }
Exemplo n.º 2
0
        public virtual void DownloadFile(string remotePathAndFile, string localPathAndFile)
        {
            _ftpClient.Host        = _configuration.FtpHost;
            _ftpClient.Credentials = new NetworkCredential(_configuration.FtpUsername, _configuration.FtpPassword);

            try
            {
                // begin connecting to the server
                _ftpClient.Connect();
                _ftpClient.DownloadFile(localPathAndFile, remotePathAndFile);
            }
            catch (Exception ex)
            {
                throw new FtpException(ex.Message);
            }
            finally
            {
                _ftpClient.Disconnect();
            }
        }
 public void Disconnect()
 {
     _ftpClient.Disconnect();
 }
Exemplo n.º 4
0
 public void Stop()
 {
     _ftpClient.Disconnect();
     _folderMonitor.StopWatching();
 }