Exemplo n.º 1
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();
 }
Exemplo n.º 2
0
 public void GetFile(string localFile, string remoteFile)
 {
     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.StartTransfer();
 }