コード例 #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
ファイル: FtpDirectory.cs プロジェクト: ellen50/gsf
        /// <summary>
        /// Starts asynchrnonous local file upload 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 BeginPutFile(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.StartAsyncTransfer();
        }
コード例 #4
0
ファイル: FtpDirectory.cs プロジェクト: ellen50/gsf
        /// <summary>
        /// Starts asynchronous remote file download 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 BeginGetFile(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.StartAsyncTransfer();
            }
            else
            {
                throw new FtpFileNotFoundException(remoteFile);
            }
        }