Limit-transfer-speed-using-SFTP-protocol - WeOnlyDo Software example code



All

wodCrypt (12)
wodSSH (10)
wodSFTP (23)
wodSSHServer (1)
wodSSHTunnel (11)
wodSSHpackage
wodSFTPdll

wodSSH.NET (10)
wodSFTP.NET (24)
wodFtpDLX.NET (22)
wodWebServer.NET (10)

wodAppUpdate (13)
wodHttpDLX (8)
wodFtpDLX (22)
wodTelnetDLX
wodFTPServer (3)
wodWebServer (10)
wodVPN
wodXMPP (13)
All ** [Visual Basic] ** [C#] ** [VB.NET] **

Limit transfer speed using SFTP protocol
VB code
Dim wodSFTP1 As wodSFTPCom
Set wodSFTP1 = New wodSFTPCom

'Authenticate with server using hostname, login, password.
wodSFTP1.HostName = "your_hostname"
wodSFTP1.Login = "your_login"
wodSFTP1.Password = "your_password"
wodSFTP1.Blocking = True  'Use synchronous connections

'MaxTransferRate determines maximum upload/download speed.
'Speed is presented as bytes per second.
'In this example we will set transfer speed to 10 KBps (kilobytes per second).
'Of course you can specify transfer speed to any value you want.
wodSFTP1.MaxTransferRate = 1024 * 10&
wodSFTP1.Connect

'In this example we will upload file to server using PutFile Method.
'Same code applies for file download.
'In that case you should only change PutFile Method line in this code with GetFile Method.
wodSFTP1.PutFile "c:\somefile.txt", "/home/somefolder/"
VB.NET code
Dim wodSFTP1 As New WeOnlyDo.Client.SFTP

'Authenticate with server using hostname, login, password.
wodSFTP1.Hostname = "your_hostname"
wodSFTP1.Login = "your_login"
wodSFTP1.Password = "your_password"
wodSFTP1.Blocking = True  'Use synchronous connections

'MaxTransferRate determines maximum upload/download speed.
'Speed is presented as bytes per second.
'In this example we will set transfer speed to 10 KBps (kilobytes per second).
'Of course you can specify transfer speed to any value you want.
wodSFTP1.MaxTransferRate = 1024 * 10
wodSFTP1.Connect()

'In this example we will upload file to server using PutFile Method.
'Same code applies for file download.
'In that case you should only change PutFile Method line in this code with GetFile Method.
wodSFTP1.PutFile("c:\somefile.txt", "/home/somefolder/")
C# code
WeOnlyDo.Client.SFTP wodSFTP1 = new WeOnlyDo.Client.SFTP();

//Authenticate with server using hostname, login, password.
wodSFTP1.Hostname = "your_hostname";
wodSFTP1.Login = "your_login";
wodSFTP1.Password = "your_password";
wodSFTP1.Blocking = true;  //Use synchronous connections

//MaxTransferRate determines maximum upload/download speed.
//Speed is presented as bytes per second.
//In this example we will set transfer speed to 10 KBps (kilobytes per second).
//Of course you can specify transfer speed to any value you want.
wodSFTP1.MaxTransferRate = 1024 * 10;
wodSFTP1.Connect();

//In this example we will upload file to server using PutFile Method.
//Same code applies for file download.
//In that case you should only change PutFile Method line in this code with GetFile Method.
wodSFTP1.PutFile("c:\\somefile.txt", "/home/somefolder/");