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(); }
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(); }
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); }