Connecting Tech Pros Worldwide Forums | Help | Site Map

sftp for Visual basic

Newbie
 
Join Date: Mar 2006
Posts: 1
#1: Mar 17 '06
Hi,

I'm looking for some sample code to do the sftp (both upload and download). I hope that someone could give me some direction to start with.

Thank you,

Will

Newbie
 
Join Date: Apr 2007
Posts: 1
#2: Apr 27 '07

re: sftp for Visual basic


Hi,
I have same problem with sftp in visual basic do you had code for it,
I really need the solve it.
please help me...

thanks,



Resta
Banned
 
Join Date: Dec 2007
Posts: 2
#3: Jul 29 '08

re: sftp for Visual basic


Hi,
here is a VB.NET sample for connecting to the SFTP server, and uploading/downloading files.

The code is taken from Rebex [URL removed] website.

Expand|Select|Wrap|Line Numbers
  1.  
  2. 'create client, connect and log in 
  3. Dim client As New SFtp
  4. client.Connect("sftp.example.org")
  5. client.Login("username", "password")
  6.  
  7. ' upload the 'test.zip' file to the current directory at the server 
  8. client.PutFile("c:\data\test.zip", "test.zip")
  9.  
  10. ' upload the 'index.html' file to the specified directory at the server 
  11. client.PutFile("c:\data\index.html", "/wwwroot/index.html")
  12.  
  13. ' download the 'test.zip' file from the current directory at the server 
  14. client.GetFile("test.zip", "c:\data\test.zip")
  15.  
  16. ' upload the 'index.html' file to the specified directory at the server 
  17. client.GetFile("/wwwroot/index.html", "c:\data\index.html")
  18.  
Reply


Similar Visual Basic 4 / 5 / 6 bytes