示例#1
0
        public override string Execute(string pathname, ClientConnection connection)
        {
            pathname = connection.NormalizeFilename(pathname);

            if (pathname != null)
            {
                var state = new ClientConnection.DataConnectionOperation {
                    Arguments = pathname, Operation = connection.ListOperation
                };

                connection.SetupDataConnectionOperation(state);

                return(string.Format("150 Opening {0} mode data transfer for LIST", connection.dataConnectionType));
            }

            return("450 Requested file action not taken");
        }
示例#2
0
        public override string Execute(string pathname, ClientConnection connection)
        {
            pathname = connection.NormalizeFilename(pathname);

            if (pathname != null)
            {
                if (File.Exists(pathname))
                {
                    var state = new ClientConnection.DataConnectionOperation {
                        Arguments = pathname, Operation = connection.RetrieveOperation
                    };

                    connection.SetupDataConnectionOperation(state);

                    return(string.Format("150 Opening {0} mode data transfer for RETR", connection.dataConnectionType));
                }
            }

            return("550 File Not Found");
        }