StartTransfer() private method

private StartTransfer ( ) : void
return void
示例#1
0
文件: FtpFile.cs 项目: qxp1011/gsf
        /// <summary>
        /// Downloads remote file using alternate local filename.
        /// </summary>
        /// <param name="localFile">Local filename to use for download.</param>
        public void Get(string localFile)
        {
            string            remoteFile = FtpPath.Combine(m_parent.FullPath, Name);
            FtpFileTransferer transferer = new FtpFileTransferer(m_parent, localFile, remoteFile, Size, TransferDirection.Download);

            transferer.StartTransfer();
        }
示例#2
0
文件: FtpFile.cs 项目: xj0229/gsf
        /// <summary>
        /// Downloads remote file using alternate local filename.
        /// </summary>
        /// <param name="localFile">Local filename to use for download.</param>
        public void Get(string localFile)
        {
            string            remoteFile = $"{m_parent.FullPath}/{Name}";
            FtpFileTransferer transferer = new FtpFileTransferer(m_parent, localFile, remoteFile, Size, TransferDirection.Download);

            transferer.StartTransfer();
        }
示例#3
0
        /// <summary>
        /// Uploads local file to directory using alternate name.
        /// </summary>
        /// <param name="localFile">Local file to upload.</param>
        /// <param name="remoteFile">Remote filename to use for upload.</param>
        public void PutFile(string localFile, string remoteFile)
        {
            CheckSessionCurrentDirectory();

            FileInfo fi = new FileInfo(localFile);

            if ((object)remoteFile == null)
            {
                remoteFile = fi.Name;
            }

            FtpFileTransferer transfer = new FtpFileTransferer(this, localFile, remoteFile, fi.Length, TransferDirection.Upload);

            transfer.StartTransfer();
        }
示例#4
0
        /// <summary>
        /// Downloads remote file from directory using alternate local filename.
        /// </summary>
        /// <param name="localFile">Local filename to use for download.</param>
        /// <param name="remoteFile">Remote filename to download.</param>
        public void GetFile(string localFile, string remoteFile)
        {
            InitHashtable();

            FtpFile file;

            if (m_files.TryGetValue(remoteFile, out file))
            {
                FtpFileTransferer transfer = new FtpFileTransferer(this, localFile, remoteFile, file.Size, TransferDirection.Download);
                transfer.StartTransfer();
            }
            else
            {
                throw new FtpFileNotFoundException(remoteFile);
            }
        }