NET SFTP Library
UploadDirectoryInParallel Method
Example 






KellermanSoftware.NetSFtpLibrary Namespace > SFTP Class : UploadDirectoryInParallel Method
The local path to put the directory
The SFTP directory to download
Upload a directory and all sub directories in parallel using two threads and two SFTP connections
Syntax
'Declaration
 
Public Function UploadDirectoryInParallel( _
   ByVal localDirectory As System.String, _
   ByVal sftpDirectory As System.String _
) As System.Collections.Generic.List(Of TransferInfo)
'Usage
 
Dim instance As SFTP
Dim localDirectory As System.String
Dim sftpDirectory As System.String
Dim value As System.Collections.Generic.List(Of TransferInfo)
 
value = instance.UploadDirectoryInParallel(localDirectory, sftpDirectory)
public System.Collections.Generic.List<TransferInfo> UploadDirectoryInParallel( 
   System.string localDirectory,
   System.string sftpDirectory
)
public function UploadDirectoryInParallel( 
    localDirectory: System.String;
    sftpDirectory: System.String
): System.Collections.Generic.List; 
public function UploadDirectoryInParallel( 
   localDirectory : System.String,
   sftpDirectory : System.String
) : System.Collections.Generic.List;
public: System.Collections.Generic.List<TransferInfo*>* UploadDirectoryInParallel( 
   System.string* localDirectory,
   System.string* sftpDirectory
) 
public:
System.Collections.Generic.List<TransferInfo^>^ UploadDirectoryInParallel( 
   System.String^ localDirectory,
   System.String^ sftpDirectory
) 

Parameters

localDirectory
The local path to put the directory
sftpDirectory
The SFTP directory to download

Return Value

A list of files transferred
Example
SFTP sftp = new SFTP(); //Trial Mode            
//SFTP sftp = new SFTP("place user name here", "place license key here");
 
// set the name of the SFTP server( its URL )
sftp.HostAddress = "sftp.fsz.bme.hu"; // a hungarian university. change this to your sftp server
sftp.UserName = "anonymus"; // replace with your user name
sftp.Password = "user@mail.com"; // replace with your password
 
sftp.EnableLogging();
sftp.Connect();
 
sftp.CurrentDirectory = "/";
 
sftp.UploadDirectoryInParallel("C:\\Download", "TestDir");
 
sftp.Disconnect();
Dim sftp As New SFTP() 'Trial Mode
'SFTP sftp = new SFTP("place user name here", "place license key here");
 
' set the name of the SFTP server( its URL )
sftp.HostAddress = "sftp.fsz.bme.hu" ' a hungarian university. change this to your sftp server
sftp.UserName = "anonymus" ' replace with your user name
sftp.Password = "user@mail.com" ' replace with your password
 
sftp.EnableLogging()
sftp.Connect()
 
sftp.CurrentDirectory = "/"
 
sftp.UploadDirectoryInParallel("C:\Download", "TestDir")
 
sftp.Disconnect()
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SFTP Class
SFTP Members