Пример #1
0
        /// <summary>
        /// Build an <see cref="IFtpClient"/> and connect to the source FTP server.
        /// </summary>
        /// <param name="peerToConnectTo">The <see cref="FtpPeer"/> to create an FTP client for.</param>
        /// <returns>An awaitable object for the Connect operation.</returns>
        public async Task<IFtpClient> ConnectAsync(FtpPeer peerToConnectTo)
        {
            var ftpClient = new FtpMessageSender(new FTPSClient());

            await ftpClient.ConnectAsync(peerToConnectTo);

            return ftpClient;
        }
Пример #2
0
        /// <summary>
        /// Build an <see cref="IFtpClient"/> and connect to the source FTP server.
        /// </summary>
        /// <param name="peerToConnectTo">The <see cref="FtpPeer"/> to create an FTP client for.</param>
        /// <returns>An awaitable object for the Connect operation.</returns>
        public async Task <IFtpClient> ConnectAsync(FtpPeer peerToConnectTo)
        {
            var ftpClient = new FtpMessageSender(new FTPSClient());

            await ftpClient.ConnectAsync(peerToConnectTo);

            return(ftpClient);
        }