示例#1
0
        private async Task <long> _commandAppeAsync(string fileName)
        {
            long size = 0;

            storeResponse = true;
            if (await executeCommandAsync("SIZE", fileName) == 213)
            {
                size = FTPCommandsHelper.GetSize(tmpResponsed);
            }

            tmpResponsed = null;

            if ((size > 0) && await setupDataConnectionAsync())
            {
                int code = await executeCommandAsync("APPE", fileName);

                if ((code == 150) || (code == 125))
                {
                    return(size);
                }
                else
                {
                    await commandAbortAsync();
                }
            }

            return(0);
        }
示例#2
0
        private async Task <bool> _commandFeatAsync()
        {
            if (serverFeat != null)
            {
                return(serverFeat.Length > 0);
            }

            storeResponse = true;
            if (await executeCommandAsync("FEAT") == 211)
            {
                serverFeat = FTPCommandsHelper.GetFeat(tmpResponsed);
            }
            tmpResponsed = null;

            return(serverFeat.Length > 0);
        }