Differences
This shows you the differences between the selected revisions of the page.
| 2014-03-03 | 2014-04-24 | ||
| key size should be 2048 bit at least nowadays (martin) | variable names distinct from class names as VB is case-insensitive (martin) | ||
| Line 105: | Line 105: | ||
| Try | Try | ||
| ' Setup session options | ' Setup session options | ||
| - | Dim sessionOptions As New SessionOptions | + | Dim mySessionOptions As New SessionOptions |
| - | With sessionOptions | + | With mySessionOptions |
| .Protocol = Protocol.Sftp | .Protocol = Protocol.Sftp | ||
| .HostName = "example.com" | .HostName = "example.com" | ||
| Line 114: | Line 114: | ||
| End With | End With | ||
| - | Using session As Session = New Session | + | Using mySession As Session = New Session |
| ' Will continuously report progress of transfer | ' Will continuously report progress of transfer | ||
| - | AddHandler session.FileTransferProgress, AddressOf SessionFileTransferProgress | + | AddHandler mySession.FileTransferProgress, AddressOf SessionFileTransferProgress |
| ' Connect | ' Connect | ||
| - | session.Open(sessionOptions) | + | mySession.Open(mySessionOptions) |
| Try | Try | ||
| ' Download files and throw on any error | ' Download files and throw on any error | ||
| - | session.GetFiles( _ | + | mySession.GetFiles( _ |
| - | "/home/martin/public_html/", "d:\backup\").Check | + | "/home/martin/public_html/", "d:\backup\").Check() |
| Finally | Finally | ||
| ' Terminate line after the last file (if any) | ' Terminate line after the last file (if any) | ||