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 156: | Line 156: | ||
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 165: | Line 165: | ||
End with | End with | ||
- | Using session As Session = New Session | + | Using mySession As Session = New Session |
' Will continuously report progress of synchronization | ' Will continuously report progress of synchronization | ||
- | AddHandler session.FileTransferred, AddressOf FileTransferred | + | AddHandler mySession.FileTransferred, AddressOf FileTransferred |
' Connect | ' Connect | ||
- | session.Open(sessionOptions) | + | mySession.Open(mySessionOptions) |
' Synchronize files | ' Synchronize files | ||
- | Dim synchronizationResult As SynchronizationResult | + | Dim mySynchronizationResult As SynchronizationResult |
- | synchronizationResult = _ | + | mySynchronizationResult = _ |
- | session.SynchronizeDirectories( _ | + | mySession.SynchronizeDirectories( _ |
SynchronizationMode.Remote, "d:\www", "/home/martin/public_html", False) | SynchronizationMode.Remote, "d:\www", "/home/martin/public_html", False) | ||
' Throw on any error | ' Throw on any error | ||
- | synchronizationResult.Check | + | mySynchronizationResult.Check() |
End Using | End Using | ||