login about faq

hi ,

I am trying to use chilkat.FTP2 for transferring files. but unable to get directory listing of files or copy file even all the strings declared are empty

ftp.GetFile(root + ss, OutTemp + ss); not moving file or ftp.MGetFiles(".", OutTemp);

not working...?

Chilkat.Ftp2 ftp; string root = ConfigurationManager.AppSettings["root"].ToString();

string OutTemp = ConfigurationManager.AppSettings["OutTemp"].ToString();

string Out = ConfigurationManager.AppSettings["Out"].ToString();

string Failed = ConfigurationManager.AppSettings["Failed"].ToString();

using (ftp=new Chilkat.Ftp2())

{

ftp.Hostname = ConfigurationManager.AppSettings["FTPServer"].ToString();

ftp.Username =ConfigurationManager.AppSettings["FTPUserName"].ToString();

ftp.Password = ConfigurationManager.AppSettings["FTPPassword"].ToString();

List<string> files = new List<string>();

if (ftp.Connect() )

{

if (ftp.ChangeRemoteDir(root))

                {
                    string a = ftp.GetXmlDirListing("*.*");
                    string b = ftp.GetTextDirListing("*.*");
                    string c = ftp.DirTreeXml();
                    string l = ftp.ListPattern;

                    ftp.MGetFiles("*.*", OutTemp);

                    for (int i = 0; i < ftp.GetDirCount(); i++)
                    {
                        if (!ftp.GetIsDirectory(i))
                        {
                            files.Add(ftp.GetFilename(i));
                        }
                    }
                    foreach (string ss in files)
                    {
                        ftp.GetFile(root + ss, OutTemp + ss);
                        ftp.DeleteRemoteFile(ss);
                    }
                }
            }

asked Mar 12 '15 at 12:32

vasu's gravatar image

vasu
1

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×131

Asked: Mar 12 '15 at 12:32

Seen: 996 times

Last updated: Mar 12 '15 at 12:32

powered by OSQA