hi
i am trying out the new version of edtFTPnet/PRO v7.2.0.20. i am currently running 6.5.0.20. i am using VS2005.
when i switch the edtFTPnetPRO.dll in my VS Project, i get the following error
System.InvalidCastException was caught
Message="Unable to cast object of type 'EnterpriseDT.Net.Ftp.FTPClient' to type 'EnterpriseDT.Net.Ftp.ExFTPClient'."
Source="edtFTPnetPRO"
StackTrace:
at EnterpriseDT.Net.Ftp.FTPConnection.jjTdifWTG()
at EnterpriseDT.Net.Ftp.FTPConnection.PostLogin()
at EnterpriseDT.Net.Ftp.FTPConnection.Connect()
at ClassLibrary1.Centech_FTP.Connect_Ftp() in C:\Documents and Settings\bill\My Documents\Visual Studio 2005\Projects\Centech_FTP_New\Centech_FTP\Centech_FTP.vb:line 292
here is my code, i have added extra try catch blocks to determine the failing code.
The Code is giving the above error on the .Connect Method. the Connection is successful however. i set logging on and i can see that in the log.
Private Function Connect_Ftp() As Boolean
Try
myFTPConnection = New FTPConnection()
With myFTPConnection
.ServerAddress = strServerName
.ServerPort = strServerPort
.UserName = strUserName
.Password = strPassword
.ConnectMode = FTPConnectMode.PASV
Select Case True
Case blnAsciiMode
.TransferType = FTPTransferType.ASCII
Case blnBinaryMode
.TransferType = FTPTransferType.BINARY
Case Else
.TransferType = FTPTransferType.ASCII
End Select
If blnTLS Then
.Protocol = FileTransferProtocol.FTPSExplicit
Else
.Protocol = FileTransferProtocol.FTP
End If
' only used for Secure FTP
'.LicenseKey = strLicenseKey
'.LicenseOwner = strLicenseOwner
Try
.Connect()
Catch ex As Exception
Dim strError As String = ex.Message
End Try
Try
_LogInfo.LogInfo(String.Format("User {0} has connected to the FTP Server {1}", .UserName, .ServerAddress))
Catch ex As Exception
Dim strError As String = ex.Message
End Try
Try
strWorkingDirectory = .ServerDirectory
Catch ex As Exception
Dim strError As String = ex.Message
End Try
Return True
End With
Catch ex As Exception
strErrorMessage = String.Format("Error Connecting to FTP Server - {0}", ex.Message)
_LogInfo.LogInfo(String.Format("Error Connecting User {0} to FTP Server {1} - {2}", strUserName, strServerName, ex.Message))
Return False
End Try
End Function
Any Ideas as to what is happening?
Thanks
Bill Cottrell