Beispiel #1
0
        /// <summary>
        /// Executes a command on the server.
        /// </summary>
        public bool ExecCommand(string command)
        {
            {
                try
                {
                    ((ComponentPro.Net.Ftp)_client).SendCommand(command);
                    ((ComponentPro.Net.Ftp)_client).ReadResponse();

                    if (command.StartsWith("cwd ", StringComparison.InvariantCultureIgnoreCase))
                    {
                        _currentDirectory = _client.GetCurrentDirectory();
                        _view.UpdateRemotePath(_currentDirectory);
                    }
                }
                catch (Exception exc)
                {
                    HandleException(exc);
                    return(false);
                }
            }

            RefreshRemoteList();

            return(true);
        }