예제 #1
0
        public void BeginGetFile(string localFile, string remoteFile, FtpFileEventHandler callback)
        {
            InitHashtable();
            FtpFile file = (FtpFile)m_files[remoteFile];

            if (file == null)
            {
                throw new FtpException("Remote file (" + remoteFile + ") not found. Try refresh the directory.");
            }
            FtpFileTransferer transfer = new FtpFileTransferer(
                this,
                localFile,
                remoteFile,
                file.Size,
                TransferDirection.Download);

            transfer.StartAsyncTransfer(callback);
        }
예제 #2
0
        public void BeginPutFile(string localFile, string remoteFile, FtpFileEventHandler callback)
        {
            CheckSessionCurrentDirectory();
            FileInfo fi = new FileInfo(localFile);

            if (remoteFile == null)
            {
                remoteFile = fi.Name;
            }
            FtpFileTransferer transfer = new FtpFileTransferer(
                this,
                localFile,
                remoteFile,
                fi.Length,
                TransferDirection.Upload);

            transfer.StartAsyncTransfer(callback);
        }
예제 #3
0
        public void PutFile(string localFile, string remoteFile)
        {
            CheckSessionCurrentDirectory();
            FileInfo fi = new FileInfo(localFile);

            if (remoteFile == null)
            {
                remoteFile = fi.Name;
            }
            FtpFileTransferer transfer = new FtpFileTransferer(
                this,
                localFile,
                remoteFile,
                fi.Length,
                TransferDirection.Upload);

            transfer.StartTransfer();
        }
예제 #4
0
 public void BeginGetFile(string localFile, string remoteFile, FtpFileEventHandler callback)
 {
     InitHashtable();
     FtpFile file = (FtpFile)m_files[remoteFile];
     if (file == null)
         throw new FtpException("Remote file (" + remoteFile + ") not found. Try refresh the directory.");
     FtpFileTransferer transfer = new FtpFileTransferer(
         this,
         localFile,
         remoteFile,
         file.Size,
         TransferDirection.Download);
     transfer.StartAsyncTransfer(callback);
 }
예제 #5
0
        public void BeginPutFile(string localFile, string remoteFile, FtpFileEventHandler callback)
        {

            CheckSessionCurrentDirectory();
            FileInfo fi = new FileInfo(localFile);
            if (remoteFile == null)
                remoteFile = fi.Name;
            FtpFileTransferer transfer = new FtpFileTransferer(
                this,
                localFile,
                remoteFile,
                fi.Length,
                TransferDirection.Upload);
            transfer.StartAsyncTransfer(callback);
        }
예제 #6
0
 public void PutFile(string localFile, string remoteFile)
 {
     CheckSessionCurrentDirectory();
     FileInfo fi = new FileInfo(localFile);
     if (remoteFile == null)
         remoteFile = fi.Name;
     FtpFileTransferer transfer = new FtpFileTransferer(
         this,
         localFile,
         remoteFile,
         fi.Length,
         TransferDirection.Upload);
     transfer.StartTransfer();
 }