Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3k views
in .NET FTP by (1.1k points)
I am using a trial version. We are evaluating for an application that will be distributed to many clients.

I can easily connect using code like this:

   sftp = New SecureFTPConnection

            sftp.ServerAddress = ftpServer
            sftp.ServerPort = 990
            sftp.UserName = ftpUser
            sftp.Password = ftpPassword

            sftp.ConnectMode = FTPConnectMode.ACTIVE
            sftp.Protocol = FileTransferProtocol.FTPSImplicit
            sftp.ServerValidation = SecureFTPServerValidationType.None
            sftp.SSLVersion = SSLFTPSSLVersion.SSL3
            sftp.Timeout = 15
            sftp.Connect()


I am having problems validating a connection. For example, i have a settings screen. I have a button called Test FTP so that a client can test that they entered the approriate settings.

I have the code above wrapped in a Try - Catch, but the error never gets thrown. I get this when a wrong IP Address is used:

System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="edtFTPnetPRO"
StackTrace:
at gv.b(Exception A_0)
at ev.h(IAsyncResult A_0)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.Socket.ConnectCallback()
at System.Net.Sockets.Socket.RegisteredWaitCallback(Object state, Boolean timedOut)
at System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object state, Boolean timedOut)

2 Answers

0 votes
by (1.1k points)
if i add these 2 lines of code:

            EnterpriseDT.Util.Debug.Logger.CurrentLevel = EnterpriseDT.Util.Debug.Level.ALL
            EnterpriseDT.Util.Debug.Logger.AddAppender(New EnterpriseDT.Util.Debug.FileAppender("C:\\ftp.txt"))


the connect drops thru to my exception handler.
0 votes
by (162k points)
We provide email support to trial evaluators - please email your log file (and if you can, your project or a cut down version that demonstrates the error) to support@.... and we'll take a look.

Categories

...