UncleSyd
We are currently evaluating the SmartFTP Library and are havign a little difficulty in establishing a connection to a Secure Server. When we use the SmartFTP Client software we have no issues but from .NET code we cannot establish a connection. I have attached the relevant code sample here (in VB.NET sorry, but its close enough to c#). Can someone tell us what we are doing wrong when we call 'EstablishConnection' ?
Thanks in advance.
Syd.
VB CLASS LISTING
Imports sfFTPLib
Public Class FTPServices
Dim strUsername As String
Dim strPassword As String
Dim strServer As String
Public objFTP As New sfFTPLib.SFTPConnection
Public Function EstablishConnection() As Boolean
' ---------------------------------------------------------------------------------
' Function - FTPServices.EstablishConnection
' Written by - Syd O
' Created on - 27 May '08
' Last Update -
' Function Purpose - To establish connection to FTP Server Securely
' ---------------------------------------------------------------------------------
If CheckLicence() Then ' Currently a Stub for testing & evaluation. ALWAY WILL RETURN TRUE
' note Server is Gene6 FTP and is configured to accept Explicit SSL on port 21
' The server operates with SmartFTP client and has no issues we are aware of
strServer = "192.168.1.114" ' Only For Testing
objFTP.Host = strServer
objFTP.Port = 21
objFTP.Username = strUsername
objFTP.Password = strPassword
objFTP.ClientHostname = System.Environment.MachineName
objFTP.Proxy.Type = enumProxyType.ftpProxyTypeNone
objFTP.Client = "VBExpress"
objFTP.LogFile = System.Environment.MachineName + ".log"
Select Case objFTP.Connect()
Case enumError.ftpErrorSuccess
MsgBox("Connected")
Case Else
MsgBox(enumError.ftpErrorConnect.ToString)
End Select
End If
End Function
Thanks in advance.
Syd.
VB CLASS LISTING
Imports sfFTPLib
Public Class FTPServices
Dim strUsername As String
Dim strPassword As String
Dim strServer As String
Public objFTP As New sfFTPLib.SFTPConnection
Public Function EstablishConnection() As Boolean
' ---------------------------------------------------------------------------------
' Function - FTPServices.EstablishConnection
' Written by - Syd O
' Created on - 27 May '08
' Last Update -
' Function Purpose - To establish connection to FTP Server Securely
' ---------------------------------------------------------------------------------
If CheckLicence() Then ' Currently a Stub for testing & evaluation. ALWAY WILL RETURN TRUE
' note Server is Gene6 FTP and is configured to accept Explicit SSL on port 21
' The server operates with SmartFTP client and has no issues we are aware of
strServer = "192.168.1.114" ' Only For Testing
objFTP.Host = strServer
objFTP.Port = 21
objFTP.Username = strUsername
objFTP.Password = strPassword
objFTP.ClientHostname = System.Environment.MachineName
objFTP.Proxy.Type = enumProxyType.ftpProxyTypeNone
objFTP.Client = "VBExpress"
objFTP.LogFile = System.Environment.MachineName + ".log"
Select Case objFTP.Connect()
Case enumError.ftpErrorSuccess
MsgBox("Connected")
Case Else
MsgBox(enumError.ftpErrorConnect.ToString)
End Select
End If
End Function