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 95: | Line 95: | ||
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 104: | Line 104: | ||
End With | End With | ||
- | Using session As Session = New Session | + | Using mySession As Session = New Session |
' Connect | ' Connect | ||
- | session.Open(sessionOptions) | + | mySession.Open(mySessionOptions) |
' Execute mysqldump on the server to dump all MySQL databases and compress the results | ' Execute mysqldump on the server to dump all MySQL databases and compress the results | ||
Line 116: | Line 116: | ||
String.Format("mysqldump --opt -u {0} --password={1} --all-databases | gzip > {2}", _ | String.Format("mysqldump --opt -u {0} --password={1} --all-databases | gzip > {2}", _ | ||
dbUsername, dbPassword, tempFilePath) | dbUsername, dbPassword, tempFilePath) | ||
- | session.ExecuteCommand(dumpCommand) | + | mySession.ExecuteCommand(dumpCommand) |
' Download the database dump | ' Download the database dump | ||
- | session.GetFiles(tempFilePath, "D:\dbbackup\").Check | + | mySession.GetFiles(tempFilePath, "D:\dbbackup\").Check() |
End Using | End Using | ||