Skip to content

Instantly share code, notes, and snippets.

@msarchet
Created September 23, 2010 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msarchet/593741 to your computer and use it in GitHub Desktop.
Save msarchet/593741 to your computer and use it in GitHub Desktop.
Private WithEvents sFTP As WeOnlyDo.Client.FtpDLX
Private Sub ConnectAndGetFile()
Try
If sFTP.State = WeOnlyDo.Client.States.Receiving Or sFTP.State = WeOnlyDo.Client.States.Connected Then
sFTP.Abort()
End If
sFTP = New WeOnlyDo.Client.FtpDLX
_status = Enums.eStatus.Downloading
sFTP.LicenseKey = "RAYJ-S8Y9-RTRE-EKZS"
sFTP.Hostname = hostname
sFTP.Login = loginName
sFTP.Password = password
sFTP.Protocol = WeOnlyDo.Client.Protocols.SFTP
sFTP.Port = 22
'This causes the sFTP_ConnectedEvent to Fire
sFTP.Connect()
Catch ex As Exception
_status = Enums.eStatus.Failed
_message = "FTP: Failed to Connect [" & MyBase.Name & "](" & ex.Message & ")"
End Try
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment