Solved

Application connecting to FTP Client Issue

Posted on 2008-10-13
3
1,427 Views
Last Modified: 2011-09-20
Hello,
I am working on a C# application which connects to FTP client to upload and download files to and from the FTP server.
When I run the application, I receive "COMException occured" error. Error HRESULT E_Fail has been returned from a call to a COM component. The error code is -2147467259.
Here the code where the error occured:
try
                {
                    int connStat = transferEngineConnection.Connect();
                    transferEngineConnection.set_Option("CleanupAsync", 1);
                    transferEngineConnection.set_Option("ThrowError ", 1);
                    transferEngineConnection.set_Option("AutoCloseMethod ", 1);
                    transferEngineConnection.set_Option("AutoCloseDelay  ", 1);

                    logger.Info("Connection Status returned: " + connStat.ToString());
                    return true;
                }
                catch(Exception ex)
                {
                    logger.Info("Connect Call Failed for CuteFTP " + ex.Message + ex.StackTrace);
                    return false;
                }
__________________________________________________________________________________________________________
System.Runtime.InteropServices.COMException occurred
  Message="Error HRESULT E_FAIL has been returned from a call to a COM component."
  Source="Interop.CuteFTPPro"
  ErrorCode=-2147467259
  StackTrace:
       at CuteFTPPro.TEConnectionClass.Connect()
       at NCR.ICCSGateway.ConnectionManager.Connect(TEConnection transferEngineConnection, String userName, String password, String server, String port, String localPath, String remotePath) in D:\NCR.ICCS.Gateway\NCR.ICCS.Gateway.SourceCode\ICCS_Gateway\ICCS_TransferGateway_Component\ICCS_Gateway_UserInterface\ConnectionManager.cs:line 500
  InnerException:

I am using CuteFTP 8 professional.

Thanks
0
Comment
Question by:houssam_ballout
3 Comments
 
LVL 12

Assisted Solution

by:ShazbotOK
ShazbotOK earned 20 total points
ID: 22706018
(1) dont use Cute ftp...  .NET 2.0 has it's own capability to use FTP right within the framework.. the CuteFTP (depending on the version you have) could be hindering the perfomance of your app by using Interop - AND old methods of transfer.
This is the MSDN developer reference for a example to how to use the FtpWebRequest namespace:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest(VS.80).aspx
 
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 80 total points
ID: 22706436
even i will recommend you to use the microsoft ftp classes that have come up with version 2.0 of the framework
here is a link of how to upload and download the files to and from the ftp server
http://www.codeproject.com/KB/IP/SimpleFTPDemo.aspx
0
 
LVL 17

Accepted Solution

by:
houssam_ballout earned 0 total points
ID: 22723800
The problem of connectivity between the application and the FTP client was solved by modifying  the configuration of the FTP client; one of the values of the configuration was FTPS which needs to be changed to FTP.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now