Example #1
0
        private static void UploadDirectory(string path, bool breUse = false)
        {
            IEnumerable <string> enumerable = Directory.GetFiles(path).Where <string>(delegate(string file)
            {
                if (breUse)
                {
                    return(bre.IsMatch(Path.GetFileName(file)));
                }
                return(true);
            });
            IEnumerable <string> enumerable2 = Directory.GetDirectories(path).Where <string>(delegate(string directory)
            {
                if (breUse)
                {
                    return(bre.IsMatch(Path.GetFileName(directory)));
                }
                return(true);
            });

            foreach (string str in enumerable)
            {
                UploadFile(str);
            }
            foreach (string str2 in enumerable2)
            {
                string fileName = Path.GetFileName(str2);
                if (!client.DirectoryExists(fileName))
                {
                    client.CreateDirectory(fileName);
                }
                Execute("CWD " + fileName, false);
                UploadDirectory(Path.Combine(path, fileName), false);
                Execute("CWD ..", false);
            }
        }
Example #2
0
 public override bool Exists(string cpath)
 {
     return(_ftpc.FileExists(cpath) || _ftpc.DirectoryExists(cpath));
 }