Question:
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);
}
}
}