Differences

This shows you the differences between the selected revisions of the page.

2012-03-09 2012-03-09
vb.net example (martin) vb.net using with statement instead of object initializer (martin)
Line 80: Line 80:
        Try         Try
            ' Setup session options             ' Setup session options
-            Dim sessionOptions As New SessionOptions { _ +            Dim sessionOptions As New SessionOptions 
-                .Protocol = Protocol.Sftp, _ +           With sessionOptions 
-                .HostName = "example.com", _ +                .Protocol = Protocol.Sftp, 
-                .UserName = "user", _ +                .HostName = "example.com", 
-                .Password = "mypassword", _ +                .UserName = "user", 
-                .SshHostKey = "ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" _ +                .Password = "mypassword", 
-            }+                .SshHostKey = "ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" 
 +            End With
            Using session As Session = New Session             Using session As Session = New Session

Last modified: by martin