Exemplo n.º 1
0
 public void DownloadResumeAsync(string localDirectory, string localFilename, string remoteDirectory, string remoteFileName)
 {
     ThreadParameters parameters = new ThreadParameters(localDirectory, localFilename, remoteDirectory, remoteFileName);
     ParameterizedThreadStart pThreadStart = new ParameterizedThreadStart(this.DoDownloadResumeAsync);
     _thread = new Thread(pThreadStart)
     {
         Name = "DownloadThread",
         IsBackground = true,
         Priority = ThreadPriority.Normal
     };
     _thread.Start(parameters);
 }
Exemplo n.º 2
0
        }// method

        /// <summary>
        /// Method uploads file to ftpServer | method does not block calling thread 
        /// | file exists on FtpServer => method overrides file
        /// | directory does not exist on FtpServer => directory is created
        /// </summary>
        /// <param name="localDirectory">directory on localhost</param>
        /// <param name="localFilename">filename on localhost</param>
        /// <param name="remoteDirectory">directory on ftpServer</param>
        /// <param name="remoteFileName">filename on ftpServer</param>
        public void UploadAsync(string localDirectory, string localFilename, string remoteDirectory, string remoteFileName)
        {
            ThreadParameters parameters = new ThreadParameters(localDirectory, localFilename, remoteDirectory, remoteFileName);
            ParameterizedThreadStart pThreadStart = new ParameterizedThreadStart(this.DoUploadAsync);
            _thread = new Thread(pThreadStart);
            _thread.Name = "UploadThread";
            _thread.IsBackground = true;
            _thread.Priority = ThreadPriority.Normal;
            _thread.Start(parameters);
        }// method