Esempio n. 1
0
        public async Task DeleteFileAsync(string path, string fileName)
        {
            var fullPath = Path.Combine(path, fileName).Replace('\\', '/');

            using (var ftpClient = new Ftp())
            {
                ftpClient.Passive      = _passive;
                ftpClient.TransferType = _transferType;

                await ftpClient.ConnectAsync(_serverAddress, _port, SslMode.None);

                await ftpClient.LoginAsync(_userName, _password);

                await ftpClient.DeleteAsync(fullPath, Rebex.IO.TraversalMode.MatchFilesShallow);

                await ftpClient.DisconnectAsync();
            }
        }